Skip to content

Commit

Permalink
schema: Use draft7 meta-schema (again)
Browse files Browse the repository at this point in the history
When splitting the schema and validator classes, we inadvertently switched
from draft7 meta-schema to draft2019-09 meta-schema which doesn't fully
work due to incomplete $recursiveRef support in jsonschema module. That's
now fixed, but only in newer versions we don't yet support.

Signed-off-by: Rob Herring <robh@kernel.org>
  • Loading branch information
robherring committed Jan 3, 2024
1 parent f00d69f commit fb80ec4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dtschema/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ def is_valid(self, strict=False):
for error in self.iter_errors():
raise error
else:
for error in self.DtValidator(self.DtValidator.META_SCHEMA).iter_errors(self):
# Using the draft7 metaschema because 2019-09 with $recursiveRef seems broken
# Probably fixed with referencing library
for error in self.DtValidator(jsonschema.Draft7Validator.META_SCHEMA).iter_errors(self):
scherr = jsonschema.exceptions.SchemaError.create_from(error)
raise scherr

Expand Down

0 comments on commit fb80ec4

Please sign in to comment.