You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
When using the generator for kotlin with the kotlinx serialization method, integer enums will be correctly serialized from integer to kotlin integer, but will be incorrectly deserialized from kotlin integer to string
This:
Where double quotes are hard-coded
They should be conditionally added, whether it's a dataType string or integer.
I'm not sure if we can do conditional checks like that is the mustaches syntax, let me know if we can, it would be a pleasure to create a PR
The text was updated successfully, but these errors were encountered:
Bug Report Checklist
Description
When using the generator for
kotlin
with the kotlinx serialization method, integer enums will be correctly serialized from integer to kotlin integer, but will be incorrectly deserialized from kotlin integer to stringThis:
Should be this:
openapi-generator version
Latest (
7.12.0
)OpenAPI declaration file content or url
Generation Details
Generate with Docker command:
docker run --rm -v $(pwd):/local openapitools/openapi-generator-cli generate -i /local/Test.yml -g kotlin -o /local/out/kotlin
Steps to reproduce
Generate with Docker command:
docker run --rm -v $(pwd):/local openapitools/openapi-generator-cli generate -i /local/Test.yml -g kotlin -o /local/out/kotlin
Related issues/PRs
Suggest a fix
The bug seems to be caused by the following line:
Where double quotes are hard-coded
They should be conditionally added, whether it's a
dataType
string or integer.I'm not sure if we can do conditional checks like that is the mustaches syntax, let me know if we can, it would be a pleasure to create a PR
The text was updated successfully, but these errors were encountered: