File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212def 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 ():
You can’t perform that action at this time.
0 commit comments