Skip to content

Imitating Named Supertype/Union Class #166

Answered by handrews
RespiteSage asked this question in Q&A
Discussion options

You must be logged in to vote

I think one of the reasons that extends was dropped gets back to the nature of JSON Schema as a constraint system for validation rather than a data definition system.

Using draft-03's extends the way you show here did not mean that the extended schema (#/definitions/distribution) would function like the version that uses oneOf. With that oneOf approach #/definitions/distribution will validate instances that look like any of those three other schemas.**

However, with extends, #/definitions/distribution will validate anything and everything, because it has no local constraints, and it is unware of the extends in the other schema objects. Of course, people could implement tools that behaved …

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@RespiteSage
Comment options

@awwright
Comment options

Comment options

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