-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
[General] Remove defunct global property withXml
from generator, docs, maven & gradle plugin
#18568
Conversation
... of course, another option would be to remove |
thanks for the PR. when you've time this week, can you please PM me via Slack? https://join.slack.com/t/openapi-generator/shared_invite/zt-12jxxd7p2-XUeQM~4pzsU9x~eGLQqX2g |
my take is to remove withXml from the global option and added it as a generator option instead to the generators that support XML payload. |
Fully agreed – the best code is code that can be deleted, meaning less complexity. Will rebase and commit the removal on top of my existing changes. |
1decced
to
de6033a
Compare
withXml
withXml
from generator, docs, maven & gradle plugin
de6033a
to
735ee4c
Compare
@wing328 Ready – realising this is a breaking change, i now rebased this against the
|
@Philzen thanks again for the PR. can you please make this change based on current master instead as it's a breaking change with fallback and we don't need to wait for 8.0.0 major release to ship this change? |
Looking at src/main/resources/go/model_simple.mustache and src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java the GoLang seems to cater for withXml=true
735ee4c
to
8ed8ecb
Compare
Currently there is only a single reference to this value in the whole codebase (GoClientOptionsProvider). Maybe we should re-think how this file is organised (i.e. provide a clearer split / mapping / understanding what are system properties vs. global properties vs. configOptions and where to put them).
This is a "soft" breaking change: Plugin will no longer execute if user have this option – which is good, b/c it never worked as expected. We may want to hint this in the 8.0 release notes.
This is a "soft" breaking change: Plugin will no longer execute if user have this option – which is good, b/c it never worked as expected. We may want to hint this in the 8.0 release notes, so they can add it to the `configOptions` map if required, or simply delete it
8ed8ecb
to
e04c829
Compare
withXml
from generator, docs, maven & gradle pluginwithXml
from generator, docs, maven & gradle plugin
@wing328 done – ready for review & merge at your discretion :) |
@wing328 BTW – how can i add labels to my own existing PRs or issues? I've seen we have a label for that, i would have otherwise already put it on here. |
Users of the plugins can just delete it (b/c the setting never transpired through to the actual generator), or move it into
configOptions
(given the generator supports XML, you can enable it this way) should they choose so.Closes #3839
Closes #5764
Closes #8902
Likely closes #11578
The basic issue is that
withXml
is documented as a global property on the main web site as well as the maven plugin. However, no matter what value is provided, Spring or Java generators won't generate XML-related annotations (only when supplying it as aconfigOption
), rendering it effectively useless.This PR applies the global property to the CodeGen's additionalProperties – if (and only if) it not already defined via--additionalProperties
(being a<configOption>
in the maven plugin respectively).Or as a config matrix:
Before
<configOption>
--additional-properties withXml=false
--additional-properties withXml=true
--global-property withXml=false
--global-property withXml=true
After<configOption>
--additional-properties withXml=false
--additional-properties withXml=true
--global-property withXml=false
--global-property withXml=true
Also fixes the maven plugin description forwithXml
.Looking at d609893, i realized that many test cases generate files that they don't test against, so that was just a small optimization (that brought down the execution time for all tests in that file by ~20 % on my machine). Maybe out of scope and can be cherry-picked somewhere else if desired, however i realize there is a lot of potential here to bring down the test suite execution time overall.
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
(upcoming 7.1.0 minor release - breaking changes with fallbacks),8.0.x
(breaking changes without fallbacks)