from pydantic import BaseModel
class UserModel(BaseModel):
username: str
description: Optional[str] = None
FastAPI为请求体中的数据定义模型
扫描二维码,在手机上阅读
from pydantic import BaseModel
class UserModel(BaseModel):
username: str
description: Optional[str] = None