Problem
Closed enums throw on an unrecognised server value.
Proposed change
Generate enums as an open class over the four-state string field, with a closed Known enum and a Value enum that adds an unknown sentinel. Deserialization never throws; a known()/value() accessor throws on unknown; the raw string is preserved. Lint-clean names (no underscore-prefixed sentinel).
Prior art: openai-java's two-enum pattern (ReasoningEffort.kt). Realises the forward-compatible-enum direction already noted in docs/refs-comparison.md.
Acceptance
Dependencies
Priority: high · Effort: medium
Problem
Closed enums throw on an unrecognised server value.
Proposed change
Generate enums as an open class over the four-state string field, with a closed
Knownenum and aValueenum that adds an unknown sentinel. Deserialization never throws; aknown()/value()accessor throws on unknown; the raw string is preserved. Lint-clean names (no underscore-prefixed sentinel).Prior art: openai-java's two-enum pattern (
ReasoningEffort.kt). Realises the forward-compatible-enum direction already noted indocs/refs-comparison.md.Acceptance
Dependencies
Priority: high · Effort: medium