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).
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" }] } } }itemsis 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).