Enhance ErrorSchema and Page with field descriptions

Added descriptions to fields in ErrorSchema and Page classes.
This commit is contained in:
Rafael Bradley
2026-07-16 02:09:45 -03:00
committed by GitHub
parent 1fe42db1b8
commit 7723d5ef6c
+4 -4
View File
@@ -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(