Skip to content

[BUG] [Java] XmlMapper.configure removed in Jackson 3 is still used #23860

Closed

Description

@kk-mats

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
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
  1. 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.

Activity

  1. wing328 commented on May 23, 2026

    @wing328
    Member

    can you please file a PR with the suggested fix when you've time? 🙏

  2. added a commit that references this issue on May 27, 2026
    1e4794b
  3. added a commit that references this issue on May 28, 2026
    52109be
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions