[fix][Java] Added missing cli option to enable Jackson annotation#21101
[fix][Java] Added missing cli option to enable Jackson annotation#21101peace317 wants to merge 3 commits intoOpenAPITools:masterfrom
Conversation
|
if i understand it correctly, not all Java generators (client, spring, jaxrs, etc) support this option, right? |
|
@wing328 The option is defined in AbstractJavaCodegen so I would guess most of the java generators use this option. Some of the generators set this property explicitly to true (e.g. SpringCodegen) or you are able to configure it implicitly like with the serializationLibrary for the JavaClientgenerator, but you're not able to configure this option explicitly in for example the maven plugin. Thus for the jaxrs-cxf-client your left with enums without jackson annotations and not beeing able to set it anyway |
hmm..... adding an option is more for documentation purpose. without the option, it should still work because options are essentially just additional properties that one can set anything (even though the option is not added explicitly) |
|
@wing328 I didn't know that. With |
|
@peace317 thanks again for the PR i agreed with improving the documentation but as this option is not supported by ALL java related generators. we need to make it clear on that in the option description.
my guess is that previously some users do not want to have jackson annotation by default |
The option "jackson" is used in most java generators and it seems to be "true" per default except in the jaxrs-cxf-client generator. This option could not be set in the config-options of a maven-plugin, because it was not be added to the cli-options.
This was not be covered by junit tests, as they set this option in the generator. I added an integration test for that purpose.
fix #5077
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)