Closed gusfcarvalho closed 1 year ago
EXPECTED_BEHAVIOUR
$ref
keyword does not allow other keywords in draft7. it allows from draft 2019 onwards:
see https://json-schema.org/draft/2019-09/release-notes.html#core-vocabulary
there is also test for this in draft 7: check this
the mentioned schema is using $id
and $ref
as siblings in draft07, which is not allowed. in draft07, if $ref
is present, we ignore any other sibling keywords.
Thanks for the clarification @santhosh-tekuri ! I'll take this back to usnistgov/OSVAL
instead :)
When trying to compile a valid draft7 json schema like this one https://github.com/usnistgov/OSCAL/releases/download/v1.1.0/oscal_catalog_schema.json the tool returns an error as it cannot reference find valid ids on the schema.
After some troubleshooting, I think this might be related to here as in these cases, the definition both have an id and a reference to a common expression.
I already confirmed that changing it to
if _, ok := m["$ref"]; ok && d.version <7
would work, but I'm not sure the impact this would have on this tool