Skip to content

Commit 70b9562

Browse files
authored
Update jsonschema to keep up with other tools (#967)
* Convert urldefrag to urllib * Override resolver function from jsonschema
1 parent 1490d09 commit 70b9562

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def find_version(*file_paths):
4141
"boto3>=1.10.20",
4242
"Jinja2>=3.1.2",
4343
"markupsafe>=2.1.0",
44-
"jsonschema>=3.0.1,<4.0",
44+
"jsonschema>=4.0.0,<5.0",
4545
"pytest>=4.5.0",
4646
"pytest-random-order>=1.0.4",
4747
"pytest-localserver>=0.5.0",

src/rpdk/core/jsonutils/inliner.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ def __init__(self, base_uri, schema):
2626
def _walk_schema(self):
2727
self._walk(self.schema, (BASE,))
2828

29+
def resolve(self, ref):
30+
"""
31+
Resolve the given reference.
32+
"""
33+
url = self._urljoin_cache(self.resolution_scope, ref)
34+
return url, self._remote_cache(url)
35+
2936
def _walk(self, obj, old_path):
3037
if isinstance(obj, str):
3138
return # very common, easier to debug this case

src/rpdk/core/jsonutils/renamer.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from itertools import count
2-
3-
from jsonschema.compat import urldefrag
2+
from urllib.parse import urldefrag
43

54
from .pointer import fragment_decode
65

0 commit comments

Comments
 (0)