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
["Soft" Breaking Change] Remove defunct global property withXml
from generator, docs, maven & gradle plugin
#18568
base: 8.0.x
Are you sure you want to change the base?
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
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
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
de6033a
to
735ee4c
Compare
@wing328 Ready – realising this is a breaking change, i now rebased this against the
|
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, #5764, and probably also #8902 and #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)