swagger-api / swagger-api/swagger-codegen
[Jaxrs-cxf] Jaxrs-cxf inheritance is not working through discriminator
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
@Jsontypeinfo and @Jsonsubtypes annotations should be normally generated while using discriminator. But they are not getting generated while using Jaxrs-cxf.
Does this mean Jaxrs-cxf doesn't support discriminator way of inheritance for the POJO classes?
Swagger-codegen version
v2.2.3
Not a regression - Missing functionality
Steps to reproduce
Use jaxrs/cxf with discriminator and see if @JsonTypeInfo and @JsonSubTypes are generated.
Expected: @JsonTypeInfo and @JsonSubTypes tags are present in superclass
Actual: Annotations are missing
Related issues/PRs
Suggest a fix/enhancement
I checked the code and I don't see {{#discriminator}} in the pojo.mustache of JavaJaxRS/cxf .
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
Start with the Java Jaxrs-cxf pojo.mustache template, where the issue reports that discriminator handling is absent. Reproduce generation with a discriminator and inheritance, then verify that the superclass output contains @JsonTypeInfo and @JsonSubTypes annotations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, tooling
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100