swagger-api / swagger-api/swagger-codegen
[jaxrs-resteasy-eap/java] with "withXml" not generating annotations for XML
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
Hi,
we have an API which supports both xml and json - however only the json annotations are added.
https://github.com/t1m0/swagger-codegen-sample
Maybe our configuration is wrong? I wasn't able to find a related issue.
Currently:
@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaResteasyEapServerCodegen", date = "2022-03-01T10:36:29.360226+01:00[Europe/Berlin]")
public class SampleResponse {
private String message = null;
@Schema(required = true, description = "")
@JsonProperty("message")
@NotNull
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
...
}
Expected:
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "SampleResponse",propOrder = {"xml"})
@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaResteasyEapServerCodegen", date = "2022-03-01T10:36:29.360226+01:00[Europe/Berlin]")
public class SampleResponse {
private String message = null;
@XmlElement(required = true)
@Schema(required = true, description = "")
@JsonProperty("message")
@NotNull
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
...
}
Kind regards
Timo
Swagger-codegen version
Swagger Code Gen Version: 1.0.31
Swagger Code Gen Maven Plugin Version: 3.0.31
Sample project
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the reported output with the linked swagger-codegen-sample project and the JavaResteasyEapServerCodegen entry point named in the generated annotation. Compare the withXml configuration's generated Java output with the expected JAXB class and property annotations; done means XML annotations are emitted alongside the existing JSON annotations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100