[python][template] move _path_to_item of simple init to avoid name error (#8737)

* [python][template] move _path_to_item of simple init up so its avaliable for missing default errors

* update generated examples
This commit is contained in:
Ronny Pfannschmidt
2021-02-23 06:00:14 +01:00
committed by GitHub
parent 19f43b5330
commit eb3d6d2f16
14 changed files with 28 additions and 14 deletions

View File

@@ -136,6 +136,8 @@ class AnimalFarm(ModelSimple):
through its discriminator because we passed in
_visited_composed_classes = (Animal,)
"""
# required up here when default value is not given
_path_to_item = kwargs.pop('_path_to_item', ())
if 'value' in kwargs:
value = kwargs.pop('value')
@@ -151,7 +153,6 @@ class AnimalFarm(ModelSimple):
_check_type = kwargs.pop('_check_type', True)
_spec_property_naming = kwargs.pop('_spec_property_naming', False)
_path_to_item = kwargs.pop('_path_to_item', ())
_configuration = kwargs.pop('_configuration', None)
_visited_composed_classes = kwargs.pop('_visited_composed_classes', ())

View File

@@ -136,6 +136,8 @@ class EnumClass(ModelSimple):
through its discriminator because we passed in
_visited_composed_classes = (Animal,)
"""
# required up here when default value is not given
_path_to_item = kwargs.pop('_path_to_item', ())
if 'value' in kwargs:
value = kwargs.pop('value')
@@ -147,7 +149,6 @@ class EnumClass(ModelSimple):
_check_type = kwargs.pop('_check_type', True)
_spec_property_naming = kwargs.pop('_spec_property_naming', False)
_path_to_item = kwargs.pop('_path_to_item', ())
_configuration = kwargs.pop('_configuration', None)
_visited_composed_classes = kwargs.pop('_visited_composed_classes', ())

View File

@@ -135,6 +135,8 @@ class NumberWithValidations(ModelSimple):
through its discriminator because we passed in
_visited_composed_classes = (Animal,)
"""
# required up here when default value is not given
_path_to_item = kwargs.pop('_path_to_item', ())
if 'value' in kwargs:
value = kwargs.pop('value')
@@ -150,7 +152,6 @@ class NumberWithValidations(ModelSimple):
_check_type = kwargs.pop('_check_type', True)
_spec_property_naming = kwargs.pop('_spec_property_naming', False)
_path_to_item = kwargs.pop('_path_to_item', ())
_configuration = kwargs.pop('_configuration', None)
_visited_composed_classes = kwargs.pop('_visited_composed_classes', ())

View File

@@ -136,6 +136,8 @@ class StringEnum(ModelSimple):
through its discriminator because we passed in
_visited_composed_classes = (Animal,)
"""
# required up here when default value is not given
_path_to_item = kwargs.pop('_path_to_item', ())
if 'value' in kwargs:
value = kwargs.pop('value')
@@ -151,7 +153,6 @@ class StringEnum(ModelSimple):
_check_type = kwargs.pop('_check_type', True)
_spec_property_naming = kwargs.pop('_spec_property_naming', False)
_path_to_item = kwargs.pop('_path_to_item', ())
_configuration = kwargs.pop('_configuration', None)
_visited_composed_classes = kwargs.pop('_visited_composed_classes', ())