diff --git a/schemas/book.py b/schemas/book.py index 4e6d3cd..bae9775 100644 --- a/schemas/book.py +++ b/schemas/book.py @@ -6,8 +6,11 @@ class BookBase(BaseModel): title: str = Field(..., min_length=1, max_length=200, description="Book title") description: Optional[str] = Field(None, description="Book description") isbn: str = Field(..., description="Book ISBN number") - publication_year: int = Field(..., ge=1000, le=9999, description="Year of publication") author_id: str = Field(..., description="ID of the book's author") + publication_year: int = Field(..., ge=1000, le=2100, description="Year of publication") + pages: int = Field(..., gt=0, description="Number of pages") + genre: str = Field(..., description="Book genre") + publisher: str = Field(..., description="Book publisher") class BookCreate(BookBase): class Config: @@ -16,8 +19,11 @@ class BookCreate(BookBase): "title": "The Great Gatsby", "description": "A novel by F. Scott Fitzgerald", "isbn": "978-0743273565", + "author_id": "author_uuid", "publication_year": 1925, - "author_id": "author_uuid_here" + "pages": 180, + "genre": "Fiction", + "publisher": "Scribner" } } @@ -32,7 +38,10 @@ class Book(BookBase): "title": "The Great Gatsby", "description": "A novel by F. Scott Fitzgerald", "isbn": "978-0743273565", + "author_id": "author_uuid", "publication_year": 1925, - "author_id": "author_uuid_here" + "pages": 180, + "genre": "Fiction", + "publisher": "Scribner" } } \ No newline at end of file