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(