forked from mtusi2026/mtusi2026lab2
Lab2: PostgreSQL, Bearer sessions and Redis for grade 4
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
"""Схемы тел запросов для OpenAPI / Swagger (валидация домена — в services)."""
|
||||
from typing import List
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
|
||||
|
||||
class CreateUserBody(BaseModel):
|
||||
model_config = ConfigDict(extra="forbid")
|
||||
|
||||
username: str = Field(..., examples=["alice"])
|
||||
display_name: str = Field(..., examples=["Алиса"])
|
||||
password: str = Field(..., examples=["Example-only-not-a-real-secret-123"])
|
||||
|
||||
|
||||
class CreateChatBody(BaseModel):
|
||||
model_config = ConfigDict(extra="forbid")
|
||||
|
||||
title: str = Field(..., examples=["Проект по ВНП"])
|
||||
member_ids: List[str] = Field(
|
||||
...,
|
||||
examples=[["11111111-1111-4111-8111-111111111111"]],
|
||||
)
|
||||
|
||||
|
||||
class CreateMessageBody(BaseModel):
|
||||
model_config = ConfigDict(extra="forbid")
|
||||
|
||||
text: str = Field(..., examples=["Привет, Боб!"])
|
||||
Reference in New Issue
Block a user