For example imagine that we have two endpoints:
class FooRequest(BaseModel):
data: str
@router.post("/foo/", response_model=FooRequest)
async def foo_view(data: FooRequest) -> FooRequest:
...
@router.get("/bar/", response_model=FooRequest)
async def bar_view(data: str = Query(..., description="Data param")) -> FooRequest:
...
In swagger UI /bar/ endpoint will have properly documented query param and /foo/ will have some abstract example of post body without any description.
So how can I document post body model?