Open Abhishek-P opened 3 years ago
I was able to workaround by adding a customizing build.gradle.mustache with following edit Have to see if I need to change pom.xml also for the usage part post build.
{{#withXml}}
compile "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:$jackson_version"
{{/withXml}}
Description
When the maven plugin is used to generate the client classes with jersey2 as the library and withXml option as true. The following import is done in model
import com.fasterxml.jackson.dataformat.xml.annotation.*;
for using
@JacksonXmlProperty(localName = "id")
But the dependency is missing in the pom.xml and the build.gradle files generated Only jaxb dependency gets added into the pom Not sure if it should be in the build.gradle also
I can see the corresponding mustache that the jacksin-dataformat is missing https://github.com/swagger-api/swagger-codegen/blob/068b1ebcb7b04a48ad38f1cadd24bb3810c9f1ab/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/pom.mustache#L251
I don't see withXML conditional in the gradle mustace - https://github.com/swagger-api/swagger-codegen/blob/068b1ebcb7b04a48ad38f1cadd24bb3810c9f1ab/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/build.gradle.mustache
Swagger-codegen version
2.3.1 Not sure if it is a regression
Swagger declaration file content or url
Not able to provide
Command line used for generation
Java codegen from swagger.json input through maven plugin XXX for used for some obfuscation for confidentiality `
Steps to reproduce
Use codege maven plugin to generate a client for Java with library jersey2 and withXml enabled as shown above
Related issues/PRs
https://github.com/swagger-api/swagger-codegen/pull/5962
Suggest a fix/enhancement
Change the mustache files to include the required libraries