I would expect this to be correctly resolved to the target schema object. Instead it is treated as a string and left as a reference. This means the Discriminator.getMapping() method returns data that is useless for deserializing a response.
The following OpenAPI json definition for the discriminator:
I would expect the values of the mapping HashMap to actually be the target classes, so that this Discriminator object can be used to dispatch to the correct subclass.
When providing a discriminator for subtypes you can provide a reference to the target type for each discriminator value (see https://swagger.io/docs/specification/data-models/inheritance-and-polymorphism/)
I would expect this to be correctly resolved to the target schema object. Instead it is treated as a string and left as a reference. This means the
Discriminator.getMapping()
method returns data that is useless for deserializing a response.The following OpenAPI json definition for the discriminator:
Produces a
Discriminator
instance (after python name mangling) like the following:I would expect the values of the
mapping
HashMap to actually be the target classes, so that thisDiscriminator
object can be used to dispatch to the correct subclass.