23 lines
752 B
Python
23 lines
752 B
Python
from pydantic import BaseModel, Field
|
|
|
|
class BreedBase(BaseModel):
|
|
name: str = Field(..., min_length=1, unique=True, index=True, description="Breed name")
|
|
description: str | None = Field(None, description="Breed description")
|
|
origin: str | None = Field(None, description="Breed origin")
|
|
breed_group: str | None = Field(None, description="Breed group")
|
|
|
|
class Config:
|
|
schema_extra = {
|
|
"example": {
|
|
"name": "Labrador Retriever",
|
|
"description": "Friendly, outgoing, and high-spirited companions",
|
|
"origin": "Canada",
|
|
"breed_group": "Sporting"
|
|
}
|
|
}
|
|
|
|
class BreedCreate(BreedBase):
|
|
pass
|
|
|
|
class BreedResponse(BreedBase):
|
|
id: int |