Skip to content

Use of oneOf with a discriminator, when the child schemas are identical? #3608

Closed Answered by smikulcik
davidjlynn asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @davidjlynn , oneOfs are incredibly hard to understand. It's more about the a validation rule for a json instance than it is about a polymorphic "type system".

I wrote a blog to help folks sort this out https://medium.com/@smikulcik/oneof-explained-c0264c429735

But yeah. If you have two identical oneOf options. No JSON instance that validates against either of those options can validate against the oneOf object.

Replies: 2 comments 1 reply

Comment options

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

Answer selected by handrews
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
4 participants