-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
[kotlin-client] Vert.x: Fix enum class name template for default operation parameters #22504
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] Vert.x: Fix enum class name template for default operation parameters #22504
Conversation
…ation parameters This change brings the class name construction in line with the other Kotlin client generators. Fixes OpenAPITools#22503
|
thanks for the pr. can you please share a spec to reproduce the issue? |
|
Sure, I'll paste the test case from the followup PR #22506 which leads to both bugs. Any spec with a defaulted enum operation parameter will exhibit this one. Please note: This was discovered while running tests for #22506 and the fix in this PR is covered by its tests. I would have lumped both fixes in a single PR, but wanted to maintain good hygiene. This bug is ultimately the result of the shotgun-surgery code smell present in the Kotlin client codebase. There is a large amount of code duplication among the mustache templates and tests either don't exist, or test for a single client. Because of this the Vert.x mustache template was overlooked during previous sweeping changes to the enum class name construction process. DRY is too often thrown around as a cargo-cultish buzzword, but some drying of the Kotlin templates might be warranted here. Or maybe a policy to ensure global changes are tested for all clients, catching omissions like this. |
|
I did a test with the spec you provided: but the output won't compile does it work for your locally? |
|
That's because of #22505 because the spec I pasted here has defualt enum value of |
|
OK. Let's get this one merged first. Thanks for the contribution. |
This change brings the class name construction in line with the other Kotlin client generators.
Fixes #22503
As described in the issue, the Vert.X template didn't construct the enum class name correctly, leading to invalid code being generated.
Changed
{{{defaultValue}}}to
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.0minor release - breaking changes with fallbacks),8.0.x(breaking changes without fallbacks)"fixes #123"present in the PR description)