You can add description using Query
or Body
depends on your use case.
from typing import Optional
from fastapi import FastAPI, Query
app = FastAPI()
@app.get("/dummy")
async def dummy(q: Optional[str] = Query(None, description="My description")):
...
You can add even more metadata, see the documentation.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…