datamodel-code-generator icon indicating copy to clipboard operation
datamodel-code-generator copied to clipboard

`generate()` for TypingTypedDict does not support LiteralType.One or LiteralType.All

Open beaubhp opened this issue 5 months ago • 0 comments
trafficstars

Tried to override Literal generation (typing module) for JSON Schema enums with >1 options. Regardless of the value passed to enum_field_as_literal, the result is always a Literal. The only workaround that was switching to JsonSchemaParser and in that environment, LiteralType.All works as intended.

beaubhp avatar Jun 03 '25 16:06 beaubhp