fix: save reference when using allOf / oneOf / anyOf (#1208)

This commit is contained in:
Algirdas Čičinskas 2025-07-21 17:18:17 +03:00 committed by GitHub
commit 5b999ac6f1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -53,7 +53,11 @@ def _prune_unused_defs(schema: dict) -> dict:
if skip_defs and k == "$defs":
continue
walk(v, current_def=current_def)
if k in ["allOf", "oneOf", "anyOf"]:
for child in v:
walk(child, current_def=current_def)
else:
walk(v, current_def=current_def)
elif isinstance(node, list):
for v in node: