Bug Report Checklist
Description
Java restclient generator with withXml and useJackson3 uses XmlMapper.configure which was removed in Jackson 3.
openapi-generator version
7.22
OpenAPI declaration file content or url
any
Generation Details
I use maven plugin.
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<execution>
<id>client</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>${project.basedir}/src/main/resources/openapi.yaml</inputSpec>
<generatorName>java</generatorName>
<withXml>true</withXml>
<configOptions>
<library>restclient</library>
<useJackson3>true</useJackson3>
<useSpringBoot4>true</useSpringBoot4>
</configOptions>
</configuration>
</execution>
</executions>
</plugin>
Steps to reproduce
mvn compile fails due to compile error due to use of XmlMapper.configure.
Related issues/PRs
Suggest a fix
|
xmlMapper.configure(ToXmlGenerator.Feature.WRITE_XML_DECLARATION, true); |
Like JsonMapper, XmlMapper.builder() should be used to get configured XmlMapper when useJackson3 is enabled.
Bug Report Checklist
Description
Java restclient generator with
withXmlanduseJackson3usesXmlMapper.configurewhich was removed in Jackson 3.openapi-generator version
7.22
OpenAPI declaration file content or url
any
Generation Details
I use maven plugin.
Steps to reproduce
mvn compilefails due to compile error due to use ofXmlMapper.configure.Related issues/PRs
Suggest a fix
openapi-generator/modules/openapi-generator/src/main/resources/Java/libraries/restclient/ApiClient.mustache
Line 242 in b1cbed1
Like
JsonMapper,XmlMapper.builder()should be used to get configuredXmlMapperwhenuseJackson3is enabled.