-
-
Notifications
You must be signed in to change notification settings - Fork 7k
[feature] Add option to disable stripping of common prefix enum #5166
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
[feature] Add option to disable stripping of common prefix enum #5166
Conversation
👍 Thanks for opening this issue! The team will review the labels and make any necessary changes. |
Looks like a couple of similar boolean options that exist in codegen use slightly different naming: |
b2abfa0
to
5c59a89
Compare
Sure, that change makes sense to me. I've updated the PR to use |
I noticed |
The same pattern to create enumVars appeared to be used in multiple places so I extracted it into a method called |
@johnflanigan nice job on getting rid of duplicate code! Looks like an important thing missing in the PR is that it doesn't |
Thanks, good point! I didn't mention anyone initially since it wasn't targeting a specific language, but I'll copy the Dart technical committee since its making a change to the |
aee108c
to
2136239
Compare
2136239
to
af4b3bb
Compare
Is anyone available to review this change? cc OpenAPI Generator Core Team: @wing328 @jimschubert @cbornet @ackintosh @jmini @etherealjoy |
I think this looks good. I'll give it a little longer for review from others on the core team due to the new getter/setter on CodegenConfig. |
Thanks for the PR. There doesn't seem to be anymore comments, so I'm merging. |
I'd like to set the <plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>4.3.0-SNAPSHOT</version>
<configuration>
<removeEnumValuePrefix>false</removeEnumValuePrefix> The property value haven't changed, the prefix is still trimmed. |
@air237 Can you try setting it in
I just tested using the Gradle plugin which I'm more familiar with and this worked:
|
@air237 Were you able to get it working? If there are problems with it, I'm happy to look into it further! |
@johnflanigan Thank you for your prompt reply. I was able to get it working. I just tested it. Thanks! |
@johnflanigan thanks for the PR, which has been included in the 4.3.0 release: https://twitter.com/oas_generator/status/1243455743937789952 |
I wonder, why is this issue circularly linked without any proper docs? Is it really fixed right now? Version? What is correct syntax to prevent this behaviour? Edit: I found a way that works properly for me, use the code from above inside of the plugin config - not execution config:
|
@unexist thanks for posting the working maven plugin config for using |
It's not working for me in version 3. Has it been ported? |
PR detail
DefaultCodegenTest
to test functionality and verify default behavior has not changed.PR checklist
./bin/
(or Windows batch scripts under.\bin\windows
) to update Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit, and these must match the expectations made by your contribution. You only need to run./bin/{LANG}-petstore.sh
,./bin/openapi3/{LANG}-petstore.sh
if updating the code or mustache templates for a language ({LANG}
) (e.g. php, ruby, python, etc).master
,4.3.x
,5.0.x
. Default:master
.cc @ircecho @swipesight @jaumard @nickmeinhold @athornz @amondnet
I'm not very familiar with open source contributing so I'll apologize in advance if anything is not correct. Happy to address any problems or things I should do differently.