Skip to content

Embedded "$schema" with different values in draft 2020-12 #59

@handrews

Description

@handrews

2019-09 and 2020-12 both allow "$schema" alongside an embedded "$id". 2019-09 states that all such embedded "$schema" keywords SHOULD have the same value as the "$schema" in the document root, but 2020-12 allows changing it, which requires some finagling when it comes to validating schemas against their meta-schemas.

Changing the value of "$schema" in an embedded resource is an unusual use case and, AFAICT, not understood by most people much less supported - it was meant to support complex bundling use cases, and one can always un-bundle the schemas to work around lack of support. Raising a NotImplementedError with a clear message would probably not be unreasonable. The JSON Schema test suite does not test this functionality at this time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions