Add explanation to enums usage as a pydantic field

This commit is contained in:
Yerassyl
2022-08-11 19:47:46 +06:00
committed by GitHub
parent 86889c2a00
commit 701d722be4

View File

@@ -89,7 +89,7 @@ class UserBase(BaseModel):
username: constr(regex="^[A-Za-z0-9-_]+$", to_lower=True, strip_whitespace=True) username: constr(regex="^[A-Za-z0-9-_]+$", to_lower=True, strip_whitespace=True)
email: EmailStr email: EmailStr
age: int = Field(ge=18, default=None) # must be greater or equal to 18 age: int = Field(ge=18, default=None) # must be greater or equal to 18
favorite_band: MusicBand = None favorite_band: MusicBand = None. # only "AEROSMITH", "QUEEN", "AC/DC" values are allowed to be inputted
website: AnyUrl = None website: AnyUrl = None
``` ```