Skip to content

Commit c37367f

Browse files
committed
LCORE-2478: improved docstring in schema_dumper
1 parent 014a5ba commit c37367f

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

src/utils/schema_dumper.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,23 @@
1212
def recursive_update(
1313
original: dict[str, Any],
1414
) -> dict[str, Any]:
15-
"""Recursively update the schema to be 100% OpenAPI-compatible.
15+
"""Transform a JSON Schema-like dictionary into an OpenAPI-compatible schema.
16+
17+
Recursively walks the input mapping and applies compatibility fixes:
18+
- converts patterns like `anyOf: [{ "type": X }, { "type": "null" }]` into
19+
a single `"type": X` with `"nullable": True` (optional types)
20+
- rewrites `"exclusiveMinimum"` to `"minimum"`
21+
- otherwise preserves entries
1622
1723
Parameters:
1824
----------
19-
original (dict): The original schema dictionary to transform.
25+
original (dict[str, Any]): Input schema dictionary that is produced by
26+
Pydantic.
2027
2128
Returns:
2229
-------
23-
dict: A new dictionary with OpenAPI-compatible transformations applied.
30+
dict[str, Any]: A new schema dictionary with all OpenAPI-compatible
31+
transformations applied.
2432
"""
2533
new: dict[str, Any] = {}
2634
for key, value in original.items():

0 commit comments

Comments
 (0)