18 lines
371 B
Python
18 lines
371 B
Python
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 |