-
Notifications
You must be signed in to change notification settings - Fork 25
Description
jsonschema
2.5.0 introduced a LRU cache in the reference resolver:
python-jsonschema/jsonschema#203
This breaks get_schema()
in some subtle ways, since we're modifying the schema while we're walking through it and dereferencing things. RefResolver.resolving()
now sometimes returns outdated parts of the structure, which causes problems.
A proper solution would be to build up a new schema in parallel while walking over the old one (which should be read-only), similar to how we do it for walking over instances. This is not a trivial change. Specifically, it's hard to properly retain cross-references in the new schema.
Related comments in the code (several parts regarding handling of references currently work more-or-less by luck):
https://github.com/avian2/jsonmerge/blob/master/jsonmerge/strategies.py#L186
https://github.com/avian2/jsonmerge/blob/master/tests/test_jsonmerge.py#L1248