v0.26.2
[v0.26.2] - 2026-05-06
Fixed
choicesfields no longer fail validation with'EnumName.MEMBER_NAME'errors. A concept declared withchoices = [...]produces aLiteral[...]field on the dynamic Pydantic class. That schema is round-tripped throughSchemaToModelFactory.make_from_json_schema(used to rebuild dynamic models on Temporal workers and to feed structured-output schemas to LLM providers). Previously the round-trip silently re-emitted the field as a plain PythonEnumclass — e.g.Literal["Strong Match", "Good Match", "Partial Match", "Poor Match"]becameclass Recommendation(Enum): Poor_Match = "Poor Match"; .... LLMs filling that schema then returned the enum's Python repr ("Recommendation.Poor_Match") instead of the literal string ("Poor Match"), which failed Pydantic validation against the original choice set with errors likeInvalid choice errors: 'recommendation': got 'Recommendation.Poor_Match', expected one of 'Strong Match', 'Good Match', 'Partial Match' or 'Poor Match'._generate_source_from_schemanow passesenum_field_as_literal=LiteralType.Alltodatamodel-code-generator, soenum: [strings]schema nodes round-trip asLiteral[...]instead of being regenerated asEnumclasses._exec_source_to_typesnow also exposesLiteralin the rebuild namespace somodel_rebuildresolves the deferred annotations.
What's Changed
- fix/enum-datamodel by @thomashebrard in #863
- Release v0.26.2 by @thomashebrard in #864
Full Changelog: v0.26.1...v0.26.2