-
-
Notifications
You must be signed in to change notification settings - Fork 7k
[kotlin-client] Add support for integer enums in serialization step #21248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[kotlin-client] Add support for integer enums in serialization step #21248
Conversation
@CHervaudBetclic did you tested this locally? |
@4brunu Hello |
Thanks, looks good to me 👍 |
@4brunu Do you have any idea about the next release date? |
You can find the next planned release date on the readme. |
…n for kotlin-client (OpenAPITools#21248)" This reverts commit 0aaeb45.
This PR was reverts #21491 |
Following this issue, when using integer enums with the kotlin-client generator, the generated enum will look like this:
You can see the values of the enum members are not integers, they are strings (
value = "0"
).Using integer enums, it's should look like this:
How to test
test.yml
file with the following content:config.json
file to generate only relevant content with the following:./mvnw clean install -DskipTests -Dmaven.javadoc.skip=true
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -i test.yml -g kotlin -o out/ -c config.json
StringCode.kt
) and integer enums (Code.kt
)PR checklist
Commit all changed files.
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*
.IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
master
(upcoming7.x.0
minor release - breaking changes with fallbacks),8.0.x
(breaking changes without fallbacks)Hello all @dr4ke616 @karismann @Zomzog @andrewemery @4brunu @yutaka0m @stefankoppier @e5l, could you take a look please? 😁