Skip to content

Is it valid to mix dialects? #254

Answered by handrews
flaksp asked this question in Q&A
Oct 18, 2022 · 2 comments · 4 replies
Discussion options

You must be logged in to vote

It's pretty confusing, TBH.

You can always $ref a separate document that is of a different draft. Each document (file or complete HTTP response, for example) is processed independently, so each is processed by its own $schema.

As of 2020-12, you can have an embedded resource within a document ($id in a subschema) with a different $schema from the root. This is a tricky case to handle, so you need to test the implementations you're using to see if they handle it correctly.

So to answer your cases:

  • $schema in a random subschema without $id: Not valid (I think not in any draft, although there might be one where it was a "SHOULD NOT" and the behavior was undefined)
  • $schema in a subschema with

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@jdesrosiers
Comment options

@handrews
Comment options

@jdesrosiers
Comment options

@handrews
Comment options

Answer selected by flaksp
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
Labels
None yet
3 participants