Skip to content

Bug introduced in FastAPI 0.111.1 #11845

Closed Answered by YuriiMotov
s-rigaud asked this question in Questions
Discussion options

You must be logged in to vote

This is not a bug. In the new version you can see correct types of Query parameters and everything seem to work as it should.

The only problem is that it doesn't show your examples, isn't it?
To specify examples you should use openapi_examples:

def filter_models(
    bizdev_ids: list[int] | None = Query(
        title="BizDev user ids", openapi_examples={"example 1": {"value": [42]}}, default=None
    ),
    pm_ids: list[int] | None = Query(title="PM user ids", openapi_examples={"Example 1": {"value": [36, 47]}}, default=None),
    designer_ids: list[int] | None = Query(
        title="Designer user ids", openapi_examples={"example 1": {"value": [666, 777]}}, default=None
    ),
) :
    "…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ThirVondukr
Comment options

Answer selected by s-rigaud
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question or problem
3 participants