Skip to content

Commit

Permalink
bugfix: Update the way specifications are retrieved.
Browse files Browse the repository at this point in the history
Fixes an issue that cropped up with referencing.jsonschema>=0.32.0
  • Loading branch information
cwacek committed Dec 26, 2023
1 parent 72e2ebf commit f58d88c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions python_jsonschema_objects/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,14 @@ def file_and_memory_handler(uri):
DeprecationWarning,
)
for uri, contents in resolved.items():
from referencing.jsonschema import specification_with

specification = specification_with(
specification_uri or self.schema["$schema"]
)
self.registry = self.registry.with_resource(
"memory:" + uri,
referencing.Resource.from_contents(
contents, specification_uri or self.schema["$schema"]
),
referencing.Resource.from_contents(contents, specification),
)

validatorClass = jsonschema.validators.validator_for(
Expand Down

0 comments on commit f58d88c

Please sign in to comment.