From d967caece56671d6cf3f95b7b66ad38eec8c7342 Mon Sep 17 00:00:00 2001 From: wilson chen Date: Wed, 15 Jul 2020 14:52:14 +0800 Subject: [PATCH] fix issue 601 --- jsonschema/_validators.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jsonschema/_validators.py b/jsonschema/_validators.py index 179fec09a..5d987de26 100644 --- a/jsonschema/_validators.py +++ b/jsonschema/_validators.py @@ -257,7 +257,10 @@ def ref(validator, ref, instance, schema): yield error else: scope, resolved = validator.resolver.resolve(ref) - validator.resolver.push_scope(scope) + if "#" in ref: + validator.resolver.push_scope(scope) + else: + validator.resolver.push_scope(str(scope).replace(ref, "")) try: for error in validator.descend(instance, resolved):