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
Generated python code for schema with discriminator doesn't populate discriminator_value_class_map in generated code. The generated code from the minimal example below is missing the discriminator_value_class_map.
Generated code:
class Distribution(object):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually.
"""
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
openapi_types = {
'class_name': 'str',
'list': 'str'
}
attribute_map = {
'class_name': 'class_name',
'list': 'list'
}
discriminator_value_class_map = {
}
When a ListDistribution or GridDistribution is received from the server, it is not deserialized into it's correct class.
Bug Report Checklist
Description
Generated python code for schema with discriminator doesn't populate
discriminator_value_class_map
in generated code. The generated code from the minimal example below is missing thediscriminator_value_class_map
.Generated code:
When a
ListDistribution
orGridDistribution
is received from the server, it is not deserialized into it's correct class.openapi-generator version
Built from most recent master 963c002
OpenAPI declaration file content or url
Command line used for generation
java -jar ~/Repos/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g python -i test.yaml -o test_client
Steps to reproduce
openapi_client.models.distribution
and look at the value ofdiscriminator_value_class_map
.Related issues/PRs
#1662
Suggest a fix
I think the lines in this example should be:
I'm happy to do some work to try to fix this, but would need to be pointed in the right direction.
The text was updated successfully, but these errors were encountered: