swagger-api / swagger-codegen

swagger-codegen contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition.
http://swagger.io
Apache License 2.0
17.02k stars 6.03k forks source link

[Jaxrs-cxf] Jaxrs-cxf inheritance is not working through discriminator #6434

Open Sridhar-1987 opened 7 years ago

Sridhar-1987 commented 7 years ago
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 .

Sridhar-1987 commented 7 years ago

It would be great if someone can confirm the issue and provide a target branch. I will create a PR for this, as the issue seems to have already fixed in Java, but still present in JaxRS

gdusart commented 5 years ago

I'm actually facing this exact issue right now, any news on this ?