-
-
Notifications
You must be signed in to change notification settings - Fork 41
Description
Hi! I started using this library and it works great. Excellent job @arthurio !
I just realized that with the latest version of Pydantic V2 the new behavior of optional fields breaks the types of the query params in the swagger documentation.
If you set your query params as "Optional" or with the notation query_param: Type | None it won't show the type on the swagger docs.
I've tried this by running the example https://github.com/arthurio/fastapi-filter/blob/main/examples/fastapi_filter_sqlalchemy.py, you'll see the only param that shows the type the only one that it's not optional: age__gte: int = Field(Query(description="this is a nice description")). If you change this param to be optional (age__gte: Optional[int] = Field(Query(description="this is a nice description"))) the type disappears
Do you know a workaround or a possible fix to this?

