forked from loafle/openapi-generator-original
[Python-experimental] Fix type error if oneof/anyof child schema is null type (#6387)
* Mustache template should use invokerPackage tag to generate import * Fix runtime exception when composed schema has 'null' type * Fix runtime exception when composed schema has 'null' type
This commit is contained in:
parent
afb3188fab
commit
583aa24152
@ -779,7 +779,7 @@ def get_discriminator_class(model_class,
|
||||
model_class._composed_schemas.get('allOf', ())
|
||||
for cls in composed_children:
|
||||
# Check if the schema has inherited discriminators.
|
||||
if cls.discriminator is not None:
|
||||
if hasattr(cls, 'discriminator') and cls.discriminator is not None:
|
||||
used_model_class = get_discriminator_class(
|
||||
cls, discr_name, discr_value, cls_visited)
|
||||
if used_model_class is not None:
|
||||
|
@ -1046,7 +1046,7 @@ def get_discriminator_class(model_class,
|
||||
model_class._composed_schemas.get('allOf', ())
|
||||
for cls in composed_children:
|
||||
# Check if the schema has inherited discriminators.
|
||||
if cls.discriminator is not None:
|
||||
if hasattr(cls, 'discriminator') and cls.discriminator is not None:
|
||||
used_model_class = get_discriminator_class(
|
||||
cls, discr_name, discr_value, cls_visited)
|
||||
if used_model_class is not None:
|
||||
|
@ -1046,7 +1046,7 @@ def get_discriminator_class(model_class,
|
||||
model_class._composed_schemas.get('allOf', ())
|
||||
for cls in composed_children:
|
||||
# Check if the schema has inherited discriminators.
|
||||
if cls.discriminator is not None:
|
||||
if hasattr(cls, 'discriminator') and cls.discriminator is not None:
|
||||
used_model_class = get_discriminator_class(
|
||||
cls, discr_name, discr_value, cls_visited)
|
||||
if used_model_class is not None:
|
||||
|
Loading…
x
Reference in New Issue
Block a user