42 lines
944 B
Python
42 lines
944 B
Python
|
|
"""Pydantic schemas for List model"""
|
||
|
|
from pydantic import BaseModel, ConfigDict, Field
|
||
|
|
|
||
|
|
|
||
|
|
class ListCreateRequest(BaseModel):
|
||
|
|
"""Schema for creating a new list"""
|
||
|
|
|
||
|
|
model_config = ConfigDict(
|
||
|
|
json_schema_extra={
|
||
|
|
"example": {
|
||
|
|
"name": "To Do",
|
||
|
|
"pos": 65535.0,
|
||
|
|
}
|
||
|
|
}
|
||
|
|
)
|
||
|
|
|
||
|
|
name: str = Field(..., min_length=1, max_length=200, description="List name")
|
||
|
|
pos: float = Field(default=65535.0, description="List position")
|
||
|
|
|
||
|
|
|
||
|
|
class ListResponse(BaseModel):
|
||
|
|
"""Schema for list response"""
|
||
|
|
|
||
|
|
model_config = ConfigDict(
|
||
|
|
from_attributes=True,
|
||
|
|
json_schema_extra={
|
||
|
|
"example": {
|
||
|
|
"id": 1,
|
||
|
|
"name": "To Do",
|
||
|
|
"closed": False,
|
||
|
|
"pos": 65535.0,
|
||
|
|
"board_id": 1,
|
||
|
|
}
|
||
|
|
},
|
||
|
|
)
|
||
|
|
|
||
|
|
id: int
|
||
|
|
name: str
|
||
|
|
closed: bool
|
||
|
|
pos: float
|
||
|
|
board_id: int
|