transformers
2e703d6c - Fix get_json_schema dropping items/enum for unions of list/dict/Literal types (#49136)

Commit
43 days ago
Fix get_json_schema dropping items/enum for unions of list/dict/Literal types (#49136) Unions whose members are list/dict/tuple/Literal were flattened into a plain `{"type": [...]}` list, silently discarding `items`, `enum`, `prefixItems` and `additionalProperties` (e.g. `str | list[str]` -> `{"type": ["array", "string"]}`, `list[str] | list[int]` -> `{"type": ["array", "array"]}`). Only bare single-key types are flattened now; anything else goes through `anyOf`. Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Author
Parents
Loading