OpenAPITools / OpenAPITools/openapi-generator

[REQ][Java][Spring] xml issue

Open
#24,155 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Hello
Could you please help me with a problem related to schema generation with the <withXml>true</withXml> parameter?
The problem is that the schema is generated with two annotations: @JacksonXmlProperty and @XmlElement. This causes a conflict and a "Class has two properties of the same name" error during the response stage.
How can I integrate it with Jaxb or XmlMapper?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with schema generation when the true parameter is enabled, then inspect how @JacksonXmlProperty and @XmlElement are added to the generated model. Reproduce the response-stage "Class has two properties of the same name" error and determine the documented integration path for JAXB or XmlMapper; done means the conflicting annotations no longer cause the error.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
api, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.