diff --git a/setup.py b/setup.py index cb2d6f15..9995d429 100644 --- a/setup.py +++ b/setup.py @@ -41,7 +41,7 @@ def find_version(*file_paths): "boto3>=1.10.20", "Jinja2>=3.1.2", "markupsafe>=2.1.0", - "jsonschema>=3.0.1,<4.0", + "jsonschema>=4.0.0,<5.0", "pytest>=4.5.0", "pytest-random-order>=1.0.4", "pytest-localserver>=0.5.0", diff --git a/src/rpdk/core/jsonutils/inliner.py b/src/rpdk/core/jsonutils/inliner.py index 149f5fce..33bae9be 100644 --- a/src/rpdk/core/jsonutils/inliner.py +++ b/src/rpdk/core/jsonutils/inliner.py @@ -26,6 +26,13 @@ def __init__(self, base_uri, schema): def _walk_schema(self): self._walk(self.schema, (BASE,)) + def resolve(self, ref): + """ + Resolve the given reference. + """ + url = self._urljoin_cache(self.resolution_scope, ref) + return url, self._remote_cache(url) + def _walk(self, obj, old_path): if isinstance(obj, str): return # very common, easier to debug this case diff --git a/src/rpdk/core/jsonutils/renamer.py b/src/rpdk/core/jsonutils/renamer.py index f3121796..3bec22a6 100644 --- a/src/rpdk/core/jsonutils/renamer.py +++ b/src/rpdk/core/jsonutils/renamer.py @@ -1,6 +1,5 @@ from itertools import count - -from jsonschema.compat import urldefrag +from urllib.parse import urldefrag from .pointer import fragment_decode