In the generated constructFromObject functions, the descriminator property is ignored, which means that an instance of the abstract superclass is created. For example, if I have this in my swagger.yaml:
Vehicle:
type: "object"
required:
- "vehicleType"
discriminator: "vehicleType"
properties:
vehicleType:
type: "string"
Car:
allOf:
- $ref: "#/definitions/Vehicle"
- type: "object"
required:
- "vehicleType"
properties:
vehicleType:
type: "string"
Bicycle:
allOf:
- $ref: "#/definitions/Vehicle"
- type: "object"
required:
- "vehicleType"
properties:
vehicleType:
type: "string"
then, according to my understanding of how it should work, if the vehicleType is "Car", then a new Car instance should be generated, and if vehicleType is "Bicycle", a new Bicycle instance should be generated.
Currently, all I get is a new Vehicle instance.
In the generated
constructFromObjectfunctions, thedescriminatorproperty is ignored, which means that an instance of the abstract superclass is created. For example, if I have this in my swagger.yaml:then, according to my understanding of how it should work, if the
vehicleTypeis"Car", then a newCarinstance should be generated, and ifvehicleTypeis"Bicycle", a newBicycleinstance should be generated.Currently, all I get is a new
Vehicleinstance.