Skip to content
Discussion options

You must be logged in to vote

Thanks, I got it. And it helps me to find several issues about it and one hack solution.

Using SkipJsonSchema removes anyOf and null from openapi.json and swagger shows parameter correctly

q: Annotated[int | SkipJsonSchema[None], Query()] = None

"parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"integer","title":"Q"}}]

#9709 (reply in thread)
pydantic/pydantic#6653 (comment)

It seems like swagger doesn't support anyOf for parameters

Replies: 3 comments 8 replies

Comment options

You must be logged in to vote
7 replies
@JavierSanchezCastro
Comment options

@zoola969
Comment options

@JavierSanchezCastro
Comment options

@zoola969
Comment options

Answer selected by YuriiMotov
@zoola969
Comment options

@leonidktoto
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question or problem
5 participants