You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use the following schema (see also: allOf example):
openapi: 3.0.0paths:
/pets:
patch:
requestBody:
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/Cat'
- $ref: '#/components/schemas/Dog'discriminator:
propertyName: pet_typeresponses:
'200':
description: Updatedcomponents:
schemas:
Pet:
type: objectrequired:
- pet_typeproperties:
pet_type:
type: stringdiscriminator:
propertyName: pet_typeDog: # "Dog" is a value for the pet_type property (the discriminator value)allOf: # Combines the main `Pet` schema with `Dog`-specific properties
- $ref: '#/components/schemas/Pet'
- type: object# all other properties specific to a `Dog`properties:
bark:
type: booleanbreed:
type: stringenum: [Dingo, Husky, Retriever, Shepherd]Cat: # "Cat" is a value for the pet_type property (the discriminator value)allOf: # Combines the main `Pet` schema with `Cat`-specific properties
- $ref: '#/components/schemas/Pet'
- type: object# all other properties specific to a `Cat`properties:
hunts:
type: booleanage:
type: integer
to generate Java client code with the following command:
Same issue exists in swagger-codegen-cli-3.0.25, but works with older version swagger-codegen-cli-3.0.19
When can I expect a fix for latest version of codegen?
When I use the following schema (see also: allOf example):
to generate Java client code with the following command:
the classes
Pet
andBody
contains invalid code:The property
pet_type
is not declared, resulting in compilation errors:I used the latest version of the code generation client (3.0.18).
Maybe this is related to #291, #296 ?
The text was updated successfully, but these errors were encountered: