Spaces:
Running
Running
Algirdas Čičinskas commited on
fix: save reference when using allOf / oneOf / anyOf (#1208)
Browse files
src/fastmcp/utilities/json_schema.py
CHANGED
|
@@ -53,7 +53,11 @@ def _prune_unused_defs(schema: dict) -> dict:
|
|
| 53 |
if skip_defs and k == "$defs":
|
| 54 |
continue
|
| 55 |
|
| 56 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
|
| 58 |
elif isinstance(node, list):
|
| 59 |
for v in node:
|
|
|
|
| 53 |
if skip_defs and k == "$defs":
|
| 54 |
continue
|
| 55 |
|
| 56 |
+
if k in ["allOf", "oneOf", "anyOf"]:
|
| 57 |
+
for child in v:
|
| 58 |
+
walk(child, current_def=current_def)
|
| 59 |
+
else:
|
| 60 |
+
walk(v, current_def=current_def)
|
| 61 |
|
| 62 |
elif isinstance(node, list):
|
| 63 |
for v in node:
|