Query parameter list / multiple values : Endpoint works but the Swagger docs not updated as expected #11494
-
First Check
Commit to Help
Example Codefrom typing import Annotated
from fastapi import FastAPI, Query
app = FastAPI()
@app.get("/items/")
async def read_items(q: Annotated[list[str] | None, Query()] = None):
query_items = {"q": q}
return query_items Description
Anyone has this behaviour as well with the Query parameter list / multiple values tutorial ? Many thanks in advance ! Operating SystemWindows Operating System DetailsNo response FastAPI Version0.109.1 Pydantic Version2.7.1 Python Version3.12.3 Additional ContextNo response |
Beta Was this translation helpful? Give feedback.
Answered by
YuriiMotov
Apr 27, 2024
Replies: 1 comment 1 reply
-
It's a well-known issue. Use
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
UbeyOzcan
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's a well-known issue. Use
SkipJsonSchema[None]
instead ofNone
in type annotation: