Skip to content

Question on declaring @anyOf on Named Unions #4387

Discussion options

You must be logged in to vote

I think in the first case it might be a confusion in the syntax that result in not exactly what you expect

In named union the variants are separated with comma ,. What you have is a union of model A and B inside that named union. So when openapi3 sees it, it sees a union with a single variant A | B so just ignore anyOf or oneOf and just render the single variant which happens to be a union which is then not annotated with @oneOf

See this playground showing the difference

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Devon-White
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants