OpenAPI-Specification icon indicating copy to clipboard operation
OpenAPI-Specification copied to clipboard

Java generate a wrong class using inheritence and discriminator

Open nabil86 opened this issue 7 years ago • 1 comments

Given this config:

  riskObject:
      type: object
      discriminator:
        propertyName: riskType
      properties:
        riskType:
          type: string

classOne:
  type: object
 allOff:
    - $ref: ''#/components/schemas/riskType'
......

After Generating a class with prefix "Api" the result is: @Validated @javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2019-01-30T15:17:33.825+01:00[Europe/Paris]") @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true ) @JsonSubTypes({ @JsonSubTypes.Type(value = **classRiskOne.class**, name = "classRiskOne") })

this result is wrong. i excpet ApiClassRiskOne.class, this is wok fin with generator version 3.1.2 but there is a regression since version 3.2.0

nabil86 avatar Feb 06 '19 17:02 nabil86

Please raise tooling-related issues on the relevant repository. This repository is for the OpenAPI specification itself. Thanks.

MikeRalphson avatar Feb 06 '19 17:02 MikeRalphson