- Update to 0.5.1:

* Setup for handling anyOf simplifying to oneOf on import.
- Add patch use-specification-obj.patch:
  * Stop passing string schemas, convert it to a Specification object

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-python-jsonschema-objects?expand=0&rev=15
This commit is contained in:
2023-12-11 05:37:10 +00:00
committed by Git OBS Bridge
parent 8e4f46a3b5
commit 0713c85eab
5 changed files with 33 additions and 4 deletions

View File

@@ -0,0 +1,19 @@
Index: python_jsonschema_objects-0.5.1/python_jsonschema_objects/__init__.py
===================================================================
--- python_jsonschema_objects-0.5.1.orig/python_jsonschema_objects/__init__.py
+++ python_jsonschema_objects-0.5.1/python_jsonschema_objects/__init__.py
@@ -125,10 +125,13 @@ class ObjectBuilder(object):
DeprecationWarning,
)
for uri, contents in resolved.items():
+ schema = specification_uri or self.schema["$schema"]
+ if isinstance(schema, str):
+ schema = referencing.jsonschema.specification_with(schema)
self.registry = self.registry.with_resource(
"memory:" + uri,
referencing.Resource.from_contents(
- contents, specification_uri or self.schema["$schema"]
+ contents, schema
),
)