Skip to content

Specify process for validating a compound schema document against meta-schema(s) #936

Closed
@handrews

Description

@handrews

PR #914 is blocked on the question of how to validate schema document containing embedded schema resources with differing meta-schemas.

In my view, when loading a schema document, an implementation should be able to recognize embedded schema resources and treat them separately, as if they were $ref'd.

There are two concerns:

  1. Do we support embedding draft-04 schemas? This requires recognizing id.

I think we should say no, if you want to use draft-04 with draft 2020-NN, you have to $ref it. Since draft-04 did not have vocabularies, there is no way to tell the difference between a custom draft-04 meta-schema relying on id and a custom meta-schema of another draft, that happens to have id next to it either b/c of a typo or someone did a really weird extension.

  1. How does the meta-schema look?

@Relequestual says:

When processing a schema document with any embedded schema resources, for the purposes of schema validation against meta-schemas (confirming the JSON Schema document is likely to be processable), embedded schema resources SHOULD be validated within their own JSON Schema feature set (using the appropriate meta-schema). For enclosing schema resources (which is likely the document root schema), an embedded resource SHOULD be considered as a valid schema document, with the value of true, for the purposes of validating the enclosing schema resource as a valid JSON Schema.

Which I almost follow but it's late and I think with the other points this deserves to be visible in an issue.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions