Skip to content

Commit

Permalink
Update jsonschema to keep up with other tools (#967)
Browse files Browse the repository at this point in the history
* Convert urldefrag to urllib
* Override resolver function from jsonschema
  • Loading branch information
kddejong authored Jun 16, 2023
1 parent 1490d09 commit 70b9562
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
7 changes: 7 additions & 0 deletions src/rpdk/core/jsonutils/inliner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions src/rpdk/core/jsonutils/renamer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from itertools import count

from jsonschema.compat import urldefrag
from urllib.parse import urldefrag

from .pointer import fragment_decode

Expand Down

0 comments on commit 70b9562

Please sign in to comment.