summaryrefslogtreecommitdiff
path: root/jsonschema/validators.py
diff options
context:
space:
mode:
Diffstat (limited to 'jsonschema/validators.py')
-rw-r--r--jsonschema/validators.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/jsonschema/validators.py b/jsonschema/validators.py
index 72af8fc..78e5829 100644
--- a/jsonschema/validators.py
+++ b/jsonschema/validators.py
@@ -1021,9 +1021,10 @@ class _RefResolver:
return None
uri, fragment = urldefrag(url)
for subschema in subschemas:
- target_uri = self._urljoin_cache(
- self.resolution_scope, subschema["$id"],
- )
+ id = subschema["$id"]
+ if not isinstance(id, str):
+ continue
+ target_uri = self._urljoin_cache(self.resolution_scope, id)
if target_uri.rstrip("/") == uri.rstrip("/"):
if fragment:
subschema = self.resolve_fragment(subschema, fragment)