Skip to content

Commit

Permalink
Copy data before recursing
Browse files Browse the repository at this point in the history
  • Loading branch information
Stranger6667 committed Aug 25, 2020
1 parent 2421d8a commit c2d2acd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hypothesis_jsonschema/_canonicalise.py
Original file line number Diff line number Diff line change
Expand Up @@ -642,11 +642,11 @@ def is_recursive(reference: str) -> bool:
val = schema.get(key, False)
if isinstance(val, list):
schema[key] = [
resolve_all_refs(v, resolver=resolver) if isinstance(v, dict) else v
resolve_all_refs(deepcopy(v), resolver=resolver) if isinstance(v, dict) else v
for v in val
]
elif isinstance(val, dict):
schema[key] = resolve_all_refs(val, resolver=resolver)
schema[key] = resolve_all_refs(deepcopy(val), resolver=resolver)
else:
assert isinstance(val, bool)
for key in SCHEMA_OBJECT_KEYS: # values are keys-to-schema-dicts, not schemas
Expand Down

0 comments on commit c2d2acd

Please sign in to comment.