-
-
Notifications
You must be signed in to change notification settings - Fork 608
Closed
Labels
BugSomething doesn't work the way it should.Something doesn't work the way it should.
Description
To reproduce:
$ python --version
Python 3.7.10 (51efa818fd9b, Apr 04 2021, 12:03:51)
[PyPy 7.3.4 with GCC Apple LLVM 12.0.0 (clang-1200.0.32.29)]
pip install jsonschema requests
import jsonschema
instance = [[{}], [{}]]
schema = {
"items": {"$ref": "#/definitions/record"},
"definitions": {
"record": {
"oneOf": [
{},
{"$ref": "https://standard.open-contracting.org/schema/1__1__5/release-schema.json"}
]
}
}
}Causes:
jsonschema.exceptions.RefResolutionError: Unresolvable JSON pointer: 'definitions/record'
The error does not occur on CPython.
The underlying cause is likely here, where we're improperly relying on the pop_scope call to run immediately on the suspended generator, whereas it really can run anytime afterwards (and does on PyPy), causing the current resolution scope to be incorrect when resolving the ref.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugSomething doesn't work the way it should.Something doesn't work the way it should.