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
16.96k stars 6.04k forks source link

Missing JsonSubTypes in Swagger Code Gen for jaxrs-jersey #9417

Open rajeswarikolluri opened 5 years ago

rajeswarikolluri commented 5 years ago

Below is the sample yaml with Inheritance and Polymorphism. While generating server stubs for JAXRS-JERSEY. Model objects doesn't contain @JsonTypeInfo and @JsonSubTypes . Is this supported in latest swagger-codegen-cli-3.0.5.jar ?

openapi: "3.0.0" info: description: "This is a sample server Petstore server." version: "1.0.0" title: "Swagger Petstore" termsOfService: "http://swagger.io/terms/" tags: •name: "pets" description: "Everything about your Pets" paths: /pets: patch: requestBody: content: application/json: schema: oneOf:

rajeswarikolluri commented 5 years ago

openapi_9417.zip

vinpai commented 5 years ago

I am facing same issue. Is there a fix or workaround for this ?

cenobyte321 commented 4 years ago

Could you try using the solution proposed in this pull request? https://github.com/swagger-api/swagger-codegen/pull/10153

rajeswarikolluri commented 3 years ago

Hi , It is still not working with swagger-codegen-cli-3.0.25.jar.

For SPRING language for the same yaml, it generates below annotation for Pet Class. If language is "JAXRS-JERSEY" then below is missing

/**