-
-
Notifications
You must be signed in to change notification settings - Fork 3
Description
I noticed that there are a couple of issues with linting schemas that include embedded schemas. Here's a minimal example where there's an embedded schema with a different dialect than the parent schema.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://example.com/main",
"$ref": "embedded",
"$defs": {
"embedded": {
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "embedded",
"allOf": [{ "$ref": "#/definitions/foo" }],
"definitions": {
"foo": { "type": "number" }
}
}
}
}EDIT: I forgot to wrap $ref in allOf for draft-07
I get the following result.
definitionswas superseded by$defsin 2019-09 and later versions
Location: Line 11, Col 7
Rule ID: definitions_to_defs
Schema: /$defs/embedded/definitions
definitionswas superseded by$defsin 2019-09 and later versions
Location: Line 11, Col 7
Rule ID: definitions_to_defs
Schema: /$defs/embedded/definitions
There are two problems with this response. Most obviously, it's the same error reported twice. But, also, it failed to detect the dialect change and it shouldn't be an error at all. definitions is correct for draft-07.