We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using maven-codegen-plugin, trying to generate PetDTO.class, with 2 classes inheriting: Cat, Dog. Java model class after generation:
@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2021-08-01T14:29:40.664+03:00[Asia/Jerusalem]")@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true ) @JsonSubTypes({ @JsonSubTypes.Type(value = DogDTO.class, name = "DogDTO"), @JsonSubTypes.Type(value = CatDTO.class, name = "CatDTO"), }) @XmlRootElement(name = "Pet") @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "Pet") public class PetDTO implements Serializable{ }
3.0.29-SNAPSHOT
schemas: Pet: type: object required: - name - type properties: id: type: integer format: int64 name: type: string example: doggie type: type: string discriminator: propertyName: type xml: name: Pet Dog: allOf: - $ref: '#/components/schemas/Pet' - type: object properties: bark: type: boolean x-discriminator-value: DogDTO Cat: allOf: - $ref: '#/components/schemas/Pet' - type: object properties: age: type: integer x-discriminator-value: CatDTO
Using swagger-maven-plugin:
<plugin> <groupId>io.swagger.codegen.v3</groupId> <artifactId>swagger-codegen-maven-plugin</artifactId> <version>3.0.28-SNAPSHOT</version> <executions> <execution> <id>petStoreRestClient</id> <goals> <goal>generate</goal> </goals> <configuration> <inputSpec>${project.basedir}/src/main/resources/petstore.yaml</inputSpec> <language>java</language> <generateModels>true</generateModels> <modelPackage>com.swagger.test.petstore.dto</modelPackage> <modelNameSuffix>DTO</modelNameSuffix> <withXml>true</withXml> <configOptions> <library>resttemplate</library> <sourceFolder>src/gen/java/main</sourceFolder> <serializationLibrary>jackson</serializationLibrary> <dateLibrary>java8</dateLibrary> <java8>true</java8> </configOptions> </configuration> </execution> </executions> </plugin>
I have submitted the following PR for this issue: #937
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description
Using maven-codegen-plugin, trying to generate PetDTO.class, with 2 classes inheriting: Cat, Dog.
Java model class after generation:
Swagger-codegen version
3.0.29-SNAPSHOT
Swagger declaration file content or url
Command line used for generation
Using swagger-maven-plugin:
Suggest a fix/enhancement
I have submitted the following PR for this issue: #937
The text was updated successfully, but these errors were encountered: