Alv*_*ona 4 python swagger openapi fastapi
如果我使用依赖系统,有没有办法将字段描述添加到 FastAPI swagger 模式?
我发现没有地方可以在FastAPI 文档的简单示例中添加描述
async def common_parameters(q: str = None, skip: int = 0, limit: int = 100):
return {"q": q, "skip": skip, "limit": limit}
Run Code Online (Sandbox Code Playgroud)
您也可以使用这个
@app.get("/dummy")
async def dummy(q: Optional[str] = Query(None, )):
"""
This is my description of the API endpoint
"""
pass
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
9511 次 |
| 最近记录: |