docs: clarify that None cannot be passed as a query parameter value
Fixes#12419
Added a warning note in the "Required, can be None" section to clarify
that query parameters are always strings in URLs — there is no way to
send a true Python None value via a query param.
Note that `None` here refers to Python's `None` value in your code logic, **not** a literal `"None"` string sent via the URL.
Query parameters are always received as strings from the URL. There is no way to send a true `None` value through a query parameter — if the client omits the parameter entirely, FastAPI will return a validation error because the parameter is required.
If you want a truly **optional** parameter that defaults to `None` when not sent, use a default value instead:
## Query parameter list / multiple values { #query-parameter-list-multiple-values }
## Query parameter list / multiple values { #query-parameter-list-multiple-values }
When you define a query parameter explicitly with `Query` you can also declare it to receive a list of values, or said in another way, to receive multiple values.
When you define a query parameter explicitly with `Query` you can also declare it to receive a list of values, or said in another way, to receive multiple values.
@ -331,7 +345,7 @@ Imagine that you want the parameter to be `item-query`.