[kotlin] Fix boolean const enum literal generation
Merged
SC
5mo ago+46+46+01234567890123456789-1-1-0123456789
Fixes #23550.
This keeps Kotlin boolean enum/const values as boolean literals when rendering enum values. Before this change, const: true could generate a Kotlin enum entry with "true" even though the enum value type is kotlin.Boolean.
I added a focused toEnumValue assertion and a generated-output regression fixture for the reported OpenAPI 3.1 boolean const: true case.
Tests:
./mvnw clean package./bin/generate-samples.sh ./bin/configs/*.yaml./bin/utils/export_docs_generators.sh
Kotlin technical committee: @karismann @Zomzog @andrewemery @4brunu @yutaka0m @stefankoppier @e5l @dennisameling
Summary by cubic
Ensure Kotlin boolean const enums are generated as boolean literals, not strings. Fixes #23550.
- Bug Fixes
- Updated
toEnumValueto pass through values forkotlin.Boolean(likekotlin.Int/kotlin.Long). - Added unit and generator tests for OpenAPI 3.1
const: truewithjvm-ktorandjackson, plus a regression fixture (issue23550-boolean-const.yaml).
- Updated