From f58d88c571f13cde99c159530c31a6d28cf063e4 Mon Sep 17 00:00:00 2001 From: Chris Wacek Date: Tue, 26 Dec 2023 16:51:14 -0500 Subject: [PATCH] bugfix: Update the way specifications are retrieved. Fixes an issue that cropped up with referencing.jsonschema>=0.32.0 --- python_jsonschema_objects/__init__.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/python_jsonschema_objects/__init__.py b/python_jsonschema_objects/__init__.py index 65508b9..22ae969 100644 --- a/python_jsonschema_objects/__init__.py +++ b/python_jsonschema_objects/__init__.py @@ -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(