forked from loafle/openapi-generator-original
[python] Add ability to get allowed values (#4138)
* Add function to get list of allowed values * [python] Add function to get list of allowed values * Remove temporary variable * Remove static method and use a variable * Remove classname
This commit is contained in:
@@ -27,6 +27,10 @@ class {{classname}}(object):
|
||||
{{/-last}}
|
||||
{{/enumVars}}{{/allowableValues}}
|
||||
|
||||
{{#allowableValues}}
|
||||
allowable_values = [{{#enumVars}}{{name}}{{^-last}}, {{/-last}}{{/enumVars}}] # noqa: E501
|
||||
|
||||
{{/allowableValues}}
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
|
||||
@@ -32,6 +32,8 @@ class EnumClass(object):
|
||||
_EFG = "-efg"
|
||||
_XYZ_ = "(xyz)"
|
||||
|
||||
allowable_values = [_ABC, _EFG, _XYZ_] # noqa: E501
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
|
||||
@@ -32,6 +32,8 @@ class OuterEnum(object):
|
||||
APPROVED = "approved"
|
||||
DELIVERED = "delivered"
|
||||
|
||||
allowable_values = [PLACED, APPROVED, DELIVERED] # noqa: E501
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
|
||||
@@ -32,6 +32,8 @@ class EnumClass(object):
|
||||
_EFG = "-efg"
|
||||
_XYZ_ = "(xyz)"
|
||||
|
||||
allowable_values = [_ABC, _EFG, _XYZ_] # noqa: E501
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
|
||||
@@ -32,6 +32,8 @@ class OuterEnum(object):
|
||||
APPROVED = "approved"
|
||||
DELIVERED = "delivered"
|
||||
|
||||
allowable_values = [PLACED, APPROVED, DELIVERED] # noqa: E501
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
|
||||
@@ -32,6 +32,8 @@ class OuterEnumDefaultValue(object):
|
||||
APPROVED = "approved"
|
||||
DELIVERED = "delivered"
|
||||
|
||||
allowable_values = [PLACED, APPROVED, DELIVERED] # noqa: E501
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
|
||||
@@ -32,6 +32,8 @@ class OuterEnumInteger(object):
|
||||
_1 = "1"
|
||||
_2 = "2"
|
||||
|
||||
allowable_values = [_0, _1, _2] # noqa: E501
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
|
||||
@@ -32,6 +32,8 @@ class OuterEnumIntegerDefaultValue(object):
|
||||
_1 = "1"
|
||||
_2 = "2"
|
||||
|
||||
allowable_values = [_0, _1, _2] # noqa: E501
|
||||
|
||||
"""
|
||||
Attributes:
|
||||
openapi_types (dict): The key is attribute name
|
||||
|
||||
Reference in New Issue
Block a user