Template
mirror of
https://github.com/Nekidev/uv-fastapi-tortoise.git
synced 2026-09-12 19:57:25 +00:00
Enhance ErrorSchema and Page with field descriptions
Added descriptions to fields in ErrorSchema and Page classes.
This commit is contained in:
@@ -29,15 +29,15 @@ class BookSchema(BaseModel):
|
||||
class ErrorSchema(BaseModel):
|
||||
"""A standard error response schema."""
|
||||
|
||||
title: str
|
||||
message: str
|
||||
title: str = Field(..., description="A short, human-readable title of the error.")
|
||||
message: str = Field(..., description="A more detailed description of the error.")
|
||||
|
||||
|
||||
class Page[T](BaseModel):
|
||||
"""A standard paginated response schema."""
|
||||
|
||||
items: list[T]
|
||||
total: int
|
||||
items: list[T] = Field(..., description="The items in the current page.")
|
||||
total: int = Field(..., description="The amount of items available across all pages for this query.")
|
||||
|
||||
@classmethod
|
||||
async def from_queryset(
|
||||
|
||||
Reference in New Issue
Block a user