Add List schema

This commit is contained in:
Backend IM Bot 2025-03-29 12:50:18 -05:00
parent 9c90381a89
commit b711bd3792

27
schemas/list.py Normal file
View File

@ -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"
}
}