diff --git a/schemas/list.py b/schemas/list.py new file mode 100644 index 0000000..17ae85e --- /dev/null +++ b/schemas/list.py @@ -0,0 +1,27 @@ +from pydantic import BaseModel, Field + +class ListBase(BaseModel): + name: str = Field(..., description="Name of the list") + description: str | None = Field(None, description="Description of the list") + +class ListCreate(ListBase): + class Config: + schema_extra = { + "example": { + "name": "Grocery List", + "description": "Items to buy from the grocery store" + } + } + +class ListResponse(ListBase): + id: int + + class Config: + orm_mode = True + schema_extra = { + "example": { + "id": 1, + "name": "Grocery List", + "description": "Items to buy from the grocery store" + } + } \ No newline at end of file