summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Berman <Julian@GrayVines.com>2021-08-25 13:54:59 +0100
committerJulian Berman <Julian@GrayVines.com>2021-08-25 13:54:59 +0100
commitbeea67bf274af08cf91064d61f647c3c1e8ae2d5 (patch)
tree465e696617a8165e788f8487ece0f06203f7d989
parent15ddd2f5d902007ca2c303180473b87375955671 (diff)
downloadjsonschema-beea67bf274af08cf91064d61f647c3c1e8ae2d5.tar.gz
Remove RefResolver.scopes_stack_copy.
This makes the (anyhow-not-yet-working) dynamicRef validators access private state on ref resolvers, but that will be fixed when aforementioned not-working is fixed.
-rw-r--r--jsonschema/_legacy_validators.py3
-rw-r--r--jsonschema/_validators.py3
-rw-r--r--jsonschema/validators.py7
3 files changed, 2 insertions, 11 deletions
diff --git a/jsonschema/_legacy_validators.py b/jsonschema/_legacy_validators.py
index b50b78f..c0bab32 100644
--- a/jsonschema/_legacy_validators.py
+++ b/jsonschema/_legacy_validators.py
@@ -207,10 +207,9 @@ def contains_draft6_draft7(validator, contains, instance, schema):
def recursiveRef(validator, recursiveRef, instance, schema):
- scope_stack = validator.resolver.scopes_stack_copy
lookup_url, target = validator.resolver.resolution_scope, validator.schema
- for each in reversed(scope_stack[1:]):
+ for each in reversed(validator.resolver._scopes_stack[1:]):
lookup_url, next_target = validator.resolver.resolve(each)
if next_target.get("$recursiveAnchor"):
target = next_target
diff --git a/jsonschema/_validators.py b/jsonschema/_validators.py
index c6d0e9a..dec6b21 100644
--- a/jsonschema/_validators.py
+++ b/jsonschema/_validators.py
@@ -299,9 +299,8 @@ def ref(validator, ref, instance, schema):
def dynamicRef(validator, dynamicRef, instance, schema):
_, fragment = urldefrag(dynamicRef)
- scope_stack = validator.resolver.scopes_stack_copy
- for url in scope_stack:
+ for url in validator.resolver._scopes_stack:
lookup_url = urljoin(url, dynamicRef)
with validator.resolver.resolving(lookup_url) as subschema:
if ("$dynamicAnchor" in subschema
diff --git a/jsonschema/validators.py b/jsonschema/validators.py
index f94e9d0..9ad5016 100644
--- a/jsonschema/validators.py
+++ b/jsonschema/validators.py
@@ -672,13 +672,6 @@ class RefResolver(object):
return self._scopes_stack[-1]
@property
- def scopes_stack_copy(self):
- """
- Retrieve a copy of the stack of resolution scopes.
- """
- return self._scopes_stack.copy()
-
- @property
def base_uri(self):
"""
Retrieve the current base URI, not including any fragment.