Skip to content

Cross spec validation of embedded schemas #203

Description

@harrel56

Let's consider a multi-spec (compound) schema:

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$ref": "#/$defs/draft2019",
  "$defs": {
    "draft2019": {
      "$schema": "https://json-schema.org/draft/2019-09/schema",
      "$id": "urn:nested",
      "items": [{
        "type": "string"
      }]
    }
  }
}

items is not valid as per draft2020 but is valid for draft2019. Now it fails because the whole JSON is validated against draft2020 meta-schema + embedded schemas individually. This is not a valid behavior according to specification (https://json-schema.org/draft/2020-12/json-schema-core#name-validating).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions