Add back schema examples

This commit is contained in:
Antoine Bertin 2021-04-28 23:04:33 +02:00
commit ce6ef720df
No known key found for this signature in database
GPG key ID: 09851B52754E2327
2 changed files with 27 additions and 0 deletions

View file

@ -15,6 +15,19 @@ class SiteSettings(CamelModel):
class Config:
orm_mode = True
schema_extra = {
"example": {
"language": "en",
"firstDayOfWeek": 0,
"showRecent": True,
"categories": [
{"id": 1, "name": "thanksgiving", "slug": "thanksgiving"},
{"id": 2, "name": "homechef", "slug": "homechef"},
{"id": 3, "name": "potatoes", "slug": "potatoes"},
],
}
}
class CustomPageBase(CamelModel):
name: str

View file

@ -12,6 +12,20 @@ class Colors(BaseModel):
class Config:
orm_mode = True
schema_extra = {
"example": {
"name": "default",
"colors": {
"primary": "#E58325",
"accent": "#00457A",
"secondary": "#973542",
"success": "#5AB1BB",
"info": "#4990BA",
"warning": "#FF4081",
"error": "#EF5350",
},
}
}
class SiteTheme(BaseModel):