15 lines
386 B
Python
15 lines
386 B
Python
from typing import Optional
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class UserEntity(BaseModel):
|
|
id: int = Field(..., example=1)
|
|
first_name: str = Field(..., example='Ivan')
|
|
last_name: str = Field(..., example='Ivanov')
|
|
patronymic: Optional[str] = Field(None, example='Ivanov')
|
|
login: str = Field(..., example='ivanov74')
|
|
|
|
role_id: int = Field(..., example=1)
|
|
|