Add Artist schema

This commit is contained in:
Backend IM Bot 2025-03-26 06:58:55 -05:00
parent f82c622ebe
commit f4964f63ab

18
schemas/artist.py Normal file
View File

@ -0,0 +1,18 @@
from pydantic import BaseModel, Field
class ArtistBase(BaseModel):
name: str = Field(..., min_length=1, index=True, unique=True, description="Artist's name")
country: str = Field("Norway", description="Artist's country of origin")
class ArtistCreate(ArtistBase):
pass
class ArtistResponse(ArtistBase):
class Config:
orm_mode = True
schema_extra = {
"example": {
"name": "Edvard Munch",
"country": "Norway"
}
}