Add None schema
This commit is contained in:
parent
e99f45bed2
commit
4ee3d16902
18
schemas/none.py
Normal file
18
schemas/none.py
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
from pydantic import BaseModel, Field
|
||||||
|
|
||||||
|
class MessageBase(BaseModel):
|
||||||
|
message: str = Field(default="yoloo!!", min_length=1)
|
||||||
|
|
||||||
|
class Config:
|
||||||
|
schema_extra = {
|
||||||
|
"example": {
|
||||||
|
"message": "yoloo!!"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class MessageCreate(MessageBase):
|
||||||
|
pass
|
||||||
|
|
||||||
|
class Message(MessageBase):
|
||||||
|
class Config:
|
||||||
|
orm_mode = True
|
Loading…
x
Reference in New Issue
Block a user