forked from loafle/openapi-generator-original
[Python] Minor fix to code format (#4172)
* test python e501 fix * 2 spaces * fix format with noqa: E501 * fix format, update samples
This commit is contained in:
parent
f763b6dce3
commit
60d601ee26
@ -115,7 +115,7 @@ class {{classname}}(object):
|
|||||||
allowed_values = [{{#isNullable}}None,{{/isNullable}}{{#allowableValues}}{{#values}}{{#items.isString}}"{{/items.isString}}{{{this}}}{{#items.isString}}"{{/items.isString}}{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}] # noqa: E501
|
allowed_values = [{{#isNullable}}None,{{/isNullable}}{{#allowableValues}}{{#values}}{{#items.isString}}"{{/items.isString}}{{{this}}}{{#items.isString}}"{{/items.isString}}{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}] # noqa: E501
|
||||||
{{#isListContainer}}
|
{{#isListContainer}}
|
||||||
if (self.local_vars_configuration.client_side_validation and
|
if (self.local_vars_configuration.client_side_validation and
|
||||||
not set({{{name}}}).issubset(set(allowed_values))):
|
not set({{{name}}}).issubset(set(allowed_values))): # noqa: E501
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"Invalid values for `{{{name}}}` [{0}], must be a subset of [{1}]" # noqa: E501
|
"Invalid values for `{{{name}}}` [{0}], must be a subset of [{1}]" # noqa: E501
|
||||||
.format(", ".join(map(str, set({{{name}}}) - set(allowed_values))), # noqa: E501
|
.format(", ".join(map(str, set({{{name}}}) - set(allowed_values))), # noqa: E501
|
||||||
@ -124,7 +124,7 @@ class {{classname}}(object):
|
|||||||
{{/isListContainer}}
|
{{/isListContainer}}
|
||||||
{{#isMapContainer}}
|
{{#isMapContainer}}
|
||||||
if (self.local_vars_configuration.client_side_validation and
|
if (self.local_vars_configuration.client_side_validation and
|
||||||
not set({{{name}}}.keys()).issubset(set(allowed_values))):
|
not set({{{name}}}.keys()).issubset(set(allowed_values))): # noqa: E501
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"Invalid keys in `{{{name}}}` [{0}], must be a subset of [{1}]" # noqa: E501
|
"Invalid keys in `{{{name}}}` [{0}], must be a subset of [{1}]" # noqa: E501
|
||||||
.format(", ".join(map(str, set({{{name}}}.keys()) - set(allowed_values))), # noqa: E501
|
.format(", ".join(map(str, set({{{name}}}.keys()) - set(allowed_values))), # noqa: E501
|
||||||
|
@ -104,7 +104,7 @@ class EnumArrays(object):
|
|||||||
"""
|
"""
|
||||||
allowed_values = ["fish", "crab"] # noqa: E501
|
allowed_values = ["fish", "crab"] # noqa: E501
|
||||||
if (self.local_vars_configuration.client_side_validation and
|
if (self.local_vars_configuration.client_side_validation and
|
||||||
not set(array_enum).issubset(set(allowed_values))):
|
not set(array_enum).issubset(set(allowed_values))): # noqa: E501
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"Invalid values for `array_enum` [{0}], must be a subset of [{1}]" # noqa: E501
|
"Invalid values for `array_enum` [{0}], must be a subset of [{1}]" # noqa: E501
|
||||||
.format(", ".join(map(str, set(array_enum) - set(allowed_values))), # noqa: E501
|
.format(", ".join(map(str, set(array_enum) - set(allowed_values))), # noqa: E501
|
||||||
|
@ -108,7 +108,7 @@ class MapTest(object):
|
|||||||
"""
|
"""
|
||||||
allowed_values = ["UPPER", "lower"] # noqa: E501
|
allowed_values = ["UPPER", "lower"] # noqa: E501
|
||||||
if (self.local_vars_configuration.client_side_validation and
|
if (self.local_vars_configuration.client_side_validation and
|
||||||
not set(map_of_enum_string.keys()).issubset(set(allowed_values))):
|
not set(map_of_enum_string.keys()).issubset(set(allowed_values))): # noqa: E501
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"Invalid keys in `map_of_enum_string` [{0}], must be a subset of [{1}]" # noqa: E501
|
"Invalid keys in `map_of_enum_string` [{0}], must be a subset of [{1}]" # noqa: E501
|
||||||
.format(", ".join(map(str, set(map_of_enum_string.keys()) - set(allowed_values))), # noqa: E501
|
.format(", ".join(map(str, set(map_of_enum_string.keys()) - set(allowed_values))), # noqa: E501
|
||||||
|
@ -1 +1 @@
|
|||||||
4.1.3-SNAPSHOT
|
4.2.0-SNAPSHOT
|
@ -3,8 +3,8 @@
|
|||||||
## Properties
|
## Properties
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**bar** | **str** | | [optional]
|
**bar** | **str** | | [optional] [readonly]
|
||||||
**foo** | **str** | | [optional]
|
**foo** | **str** | | [optional] [readonly]
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
@ -4,9 +4,9 @@
|
|||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**name** | **int** | |
|
**name** | **int** | |
|
||||||
**snake_case** | **int** | | [optional]
|
**snake_case** | **int** | | [optional] [readonly]
|
||||||
**_property** | **str** | | [optional]
|
**_property** | **str** | | [optional]
|
||||||
**_123_number** | **int** | | [optional]
|
**_123_number** | **int** | | [optional] [readonly]
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
## Properties
|
## Properties
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**bar** | **str** | | [optional]
|
**bar** | **str** | | [optional] [readonly]
|
||||||
**baz** | **str** | | [optional]
|
**baz** | **str** | | [optional]
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
@ -138,6 +138,8 @@ class Configuration(six.with_metaclass(TypeWithDefault, object)):
|
|||||||
self.retries = None
|
self.retries = None
|
||||||
"""Adding retries to override urllib3 default value 3
|
"""Adding retries to override urllib3 default value 3
|
||||||
"""
|
"""
|
||||||
|
# Disable client side validation
|
||||||
|
self.client_side_validation = True
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def logger_file(self):
|
def logger_file(self):
|
||||||
|
@ -104,7 +104,7 @@ class EnumArrays(object):
|
|||||||
"""
|
"""
|
||||||
allowed_values = ["fish", "crab"] # noqa: E501
|
allowed_values = ["fish", "crab"] # noqa: E501
|
||||||
if (self.local_vars_configuration.client_side_validation and
|
if (self.local_vars_configuration.client_side_validation and
|
||||||
not set(array_enum).issubset(set(allowed_values))):
|
not set(array_enum).issubset(set(allowed_values))): # noqa: E501
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"Invalid values for `array_enum` [{0}], must be a subset of [{1}]" # noqa: E501
|
"Invalid values for `array_enum` [{0}], must be a subset of [{1}]" # noqa: E501
|
||||||
.format(", ".join(map(str, set(array_enum) - set(allowed_values))), # noqa: E501
|
.format(", ".join(map(str, set(array_enum) - set(allowed_values))), # noqa: E501
|
||||||
|
@ -108,7 +108,7 @@ class MapTest(object):
|
|||||||
"""
|
"""
|
||||||
allowed_values = ["UPPER", "lower"] # noqa: E501
|
allowed_values = ["UPPER", "lower"] # noqa: E501
|
||||||
if (self.local_vars_configuration.client_side_validation and
|
if (self.local_vars_configuration.client_side_validation and
|
||||||
not set(map_of_enum_string.keys()).issubset(set(allowed_values))):
|
not set(map_of_enum_string.keys()).issubset(set(allowed_values))): # noqa: E501
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"Invalid keys in `map_of_enum_string` [{0}], must be a subset of [{1}]" # noqa: E501
|
"Invalid keys in `map_of_enum_string` [{0}], must be a subset of [{1}]" # noqa: E501
|
||||||
.format(", ".join(map(str, set(map_of_enum_string.keys()) - set(allowed_values))), # noqa: E501
|
.format(", ".join(map(str, set(map_of_enum_string.keys()) - set(allowed_values))), # noqa: E501
|
||||||
|
@ -104,7 +104,7 @@ class EnumArrays(object):
|
|||||||
"""
|
"""
|
||||||
allowed_values = ["fish", "crab"] # noqa: E501
|
allowed_values = ["fish", "crab"] # noqa: E501
|
||||||
if (self.local_vars_configuration.client_side_validation and
|
if (self.local_vars_configuration.client_side_validation and
|
||||||
not set(array_enum).issubset(set(allowed_values))):
|
not set(array_enum).issubset(set(allowed_values))): # noqa: E501
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"Invalid values for `array_enum` [{0}], must be a subset of [{1}]" # noqa: E501
|
"Invalid values for `array_enum` [{0}], must be a subset of [{1}]" # noqa: E501
|
||||||
.format(", ".join(map(str, set(array_enum) - set(allowed_values))), # noqa: E501
|
.format(", ".join(map(str, set(array_enum) - set(allowed_values))), # noqa: E501
|
||||||
|
@ -108,7 +108,7 @@ class MapTest(object):
|
|||||||
"""
|
"""
|
||||||
allowed_values = ["UPPER", "lower"] # noqa: E501
|
allowed_values = ["UPPER", "lower"] # noqa: E501
|
||||||
if (self.local_vars_configuration.client_side_validation and
|
if (self.local_vars_configuration.client_side_validation and
|
||||||
not set(map_of_enum_string.keys()).issubset(set(allowed_values))):
|
not set(map_of_enum_string.keys()).issubset(set(allowed_values))): # noqa: E501
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"Invalid keys in `map_of_enum_string` [{0}], must be a subset of [{1}]" # noqa: E501
|
"Invalid keys in `map_of_enum_string` [{0}], must be a subset of [{1}]" # noqa: E501
|
||||||
.format(", ".join(map(str, set(map_of_enum_string.keys()) - set(allowed_values))), # noqa: E501
|
.format(", ".join(map(str, set(map_of_enum_string.keys()) - set(allowed_values))), # noqa: E501
|
||||||
|
@ -104,7 +104,7 @@ class EnumArrays(object):
|
|||||||
"""
|
"""
|
||||||
allowed_values = ["fish", "crab"] # noqa: E501
|
allowed_values = ["fish", "crab"] # noqa: E501
|
||||||
if (self.local_vars_configuration.client_side_validation and
|
if (self.local_vars_configuration.client_side_validation and
|
||||||
not set(array_enum).issubset(set(allowed_values))):
|
not set(array_enum).issubset(set(allowed_values))): # noqa: E501
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"Invalid values for `array_enum` [{0}], must be a subset of [{1}]" # noqa: E501
|
"Invalid values for `array_enum` [{0}], must be a subset of [{1}]" # noqa: E501
|
||||||
.format(", ".join(map(str, set(array_enum) - set(allowed_values))), # noqa: E501
|
.format(", ".join(map(str, set(array_enum) - set(allowed_values))), # noqa: E501
|
||||||
|
@ -79,7 +79,7 @@ class InlineObject2(object):
|
|||||||
"""
|
"""
|
||||||
allowed_values = [">", "$"] # noqa: E501
|
allowed_values = [">", "$"] # noqa: E501
|
||||||
if (self.local_vars_configuration.client_side_validation and
|
if (self.local_vars_configuration.client_side_validation and
|
||||||
not set(enum_form_string_array).issubset(set(allowed_values))):
|
not set(enum_form_string_array).issubset(set(allowed_values))): # noqa: E501
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"Invalid values for `enum_form_string_array` [{0}], must be a subset of [{1}]" # noqa: E501
|
"Invalid values for `enum_form_string_array` [{0}], must be a subset of [{1}]" # noqa: E501
|
||||||
.format(", ".join(map(str, set(enum_form_string_array) - set(allowed_values))), # noqa: E501
|
.format(", ".join(map(str, set(enum_form_string_array) - set(allowed_values))), # noqa: E501
|
||||||
|
@ -108,7 +108,7 @@ class MapTest(object):
|
|||||||
"""
|
"""
|
||||||
allowed_values = ["UPPER", "lower"] # noqa: E501
|
allowed_values = ["UPPER", "lower"] # noqa: E501
|
||||||
if (self.local_vars_configuration.client_side_validation and
|
if (self.local_vars_configuration.client_side_validation and
|
||||||
not set(map_of_enum_string.keys()).issubset(set(allowed_values))):
|
not set(map_of_enum_string.keys()).issubset(set(allowed_values))): # noqa: E501
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"Invalid keys in `map_of_enum_string` [{0}], must be a subset of [{1}]" # noqa: E501
|
"Invalid keys in `map_of_enum_string` [{0}], must be a subset of [{1}]" # noqa: E501
|
||||||
.format(", ".join(map(str, set(map_of_enum_string.keys()) - set(allowed_values))), # noqa: E501
|
.format(", ".join(map(str, set(map_of_enum_string.keys()) - set(allowed_values))), # noqa: E501
|
||||||
|
Loading…
x
Reference in New Issue
Block a user