When I tried to generate a swagger document through schemas during the query, the default attribute is valid, but the attribute description is invalid #9671
-
Privileged issue
Issue Content |
Beta Was this translation helpful? Give feedback.
Answered by
YuriiMotov
Jun 4, 2025
Replies: 2 comments
-
|
I don't think what you are trying to do is supported by FastAPI (see #3163). Try: @app.get("/test")
async def read_query_check(name: Annotated[str, Query(title="名字", description="名字")] = "test"):
... |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Since FastAPI 0.115.0 you can make it working this way: async def read_query_check(data: NameSchemas = Query()):Docs: https://fastapi.tiangolo.com/tutorial/query-param-models/ |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
YuriiMotov
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Since FastAPI 0.115.0 you can make it working this way:
Docs: https://fastapi.tiangolo.com/tutorial/query-param-models/