diff --git a/modules/openapi-generator/src/main/resources/python-legacy/api.mustache b/modules/openapi-generator/src/main/resources/python-legacy/api.mustache index cea2c7c663961a685629837a0f3264c46ab0e67d..6b4aaf19f62f8b5674e780f3ad9f40df9f54d197 100644 --- a/modules/openapi-generator/src/main/resources/python-legacy/api.mustache +++ b/modules/openapi-generator/src/main/resources/python-legacy/api.mustache @@ -161,8 +161,7 @@ class {{classname}}(object): {{^isNullable}} {{#required}} # verify the required parameter '{{paramName}}' is set - if self.api_client.client_side_validation and ('{{paramName}}' not in local_var_params or # noqa: E501 - local_var_params['{{paramName}}'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('{{paramName}}') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `{{paramName}}` when calling `{{operationId}}`") # noqa: E501 {{/required}} {{/isNullable}} @@ -217,7 +216,7 @@ class {{classname}}(object): query_params = [] {{#queryParams}} - if '{{paramName}}' in local_var_params and local_var_params['{{paramName}}'] is not None: # noqa: E501 + if local_var_params.get('{{paramName}}') is not None: # noqa: E501 query_params.append(('{{baseName}}', local_var_params['{{paramName}}'])){{#isArray}} # noqa: E501 collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isArray}} # noqa: E501 {{/queryParams}} diff --git a/samples/client/petstore/python-asyncio/petstore_api/api/another_fake_api.py b/samples/client/petstore/python-asyncio/petstore_api/api/another_fake_api.py index 9f56ecf401d547ef9e41530e2688789b4b766772..8719c9511f1728190fa3799de3a477df85e3d7b8 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/api/another_fake_api.py +++ b/samples/client/petstore/python-asyncio/petstore_api/api/another_fake_api.py @@ -128,8 +128,7 @@ class AnotherFakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'body' is set - if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 - local_var_params['body'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `call_123_test_special_tags`") # noqa: E501 collection_formats = {} diff --git a/samples/client/petstore/python-asyncio/petstore_api/api/fake_api.py b/samples/client/petstore/python-asyncio/petstore_api/api/fake_api.py index 24fe364a0bde47a7896a7597ace3fe56200fd58c..d76ff0a0676c15ea7e3a978bef2f904aabc7bebe 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python-asyncio/petstore_api/api/fake_api.py @@ -128,8 +128,7 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'xml_item' is set - if self.api_client.client_side_validation and ('xml_item' not in local_var_params or # noqa: E501 - local_var_params['xml_item'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('xml_item') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `xml_item` when calling `create_xml_item`") # noqa: E501 collection_formats = {} @@ -804,8 +803,7 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'body' is set - if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 - local_var_params['body'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `test_body_with_file_schema`") # noqa: E501 collection_formats = {} @@ -947,12 +945,10 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'query' is set - if self.api_client.client_side_validation and ('query' not in local_var_params or # noqa: E501 - local_var_params['query'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('query') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `query` when calling `test_body_with_query_params`") # noqa: E501 # verify the required parameter 'body' is set - if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 - local_var_params['body'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `test_body_with_query_params`") # noqa: E501 collection_formats = {} @@ -960,7 +956,7 @@ class FakeApi(object): path_params = {} query_params = [] - if 'query' in local_var_params and local_var_params['query'] is not None: # noqa: E501 + if local_var_params.get('query') is not None: # noqa: E501 query_params.append(('query', local_var_params['query'])) # noqa: E501 header_params = dict(local_var_params.get('_headers', {})) @@ -1093,8 +1089,7 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'body' is set - if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 - local_var_params['body'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `test_client_model`") # noqa: E501 collection_formats = {} @@ -1304,20 +1299,16 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'number' is set - if self.api_client.client_side_validation and ('number' not in local_var_params or # noqa: E501 - local_var_params['number'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('number') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `number` when calling `test_endpoint_parameters`") # noqa: E501 # verify the required parameter 'double' is set - if self.api_client.client_side_validation and ('double' not in local_var_params or # noqa: E501 - local_var_params['double'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('double') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `double` when calling `test_endpoint_parameters`") # noqa: E501 # verify the required parameter 'pattern_without_delimiter' is set - if self.api_client.client_side_validation and ('pattern_without_delimiter' not in local_var_params or # noqa: E501 - local_var_params['pattern_without_delimiter'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('pattern_without_delimiter') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`") # noqa: E501 # verify the required parameter 'byte' is set - if self.api_client.client_side_validation and ('byte' not in local_var_params or # noqa: E501 - local_var_params['byte'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('byte') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `byte` when calling `test_endpoint_parameters`") # noqa: E501 if self.api_client.client_side_validation and 'number' in local_var_params and local_var_params['number'] > 543.2: # noqa: E501 @@ -1550,14 +1541,14 @@ class FakeApi(object): path_params = {} query_params = [] - if 'enum_query_string_array' in local_var_params and local_var_params['enum_query_string_array'] is not None: # noqa: E501 + if local_var_params.get('enum_query_string_array') is not None: # noqa: E501 query_params.append(('enum_query_string_array', local_var_params['enum_query_string_array'])) # noqa: E501 collection_formats['enum_query_string_array'] = 'csv' # noqa: E501 - if 'enum_query_string' in local_var_params and local_var_params['enum_query_string'] is not None: # noqa: E501 + if local_var_params.get('enum_query_string') is not None: # noqa: E501 query_params.append(('enum_query_string', local_var_params['enum_query_string'])) # noqa: E501 - if 'enum_query_integer' in local_var_params and local_var_params['enum_query_integer'] is not None: # noqa: E501 + if local_var_params.get('enum_query_integer') is not None: # noqa: E501 query_params.append(('enum_query_integer', local_var_params['enum_query_integer'])) # noqa: E501 - if 'enum_query_double' in local_var_params and local_var_params['enum_query_double'] is not None: # noqa: E501 + if local_var_params.get('enum_query_double') is not None: # noqa: E501 query_params.append(('enum_query_double', local_var_params['enum_query_double'])) # noqa: E501 header_params = dict(local_var_params.get('_headers', {})) @@ -1723,16 +1714,13 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'required_string_group' is set - if self.api_client.client_side_validation and ('required_string_group' not in local_var_params or # noqa: E501 - local_var_params['required_string_group'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('required_string_group') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `required_string_group` when calling `test_group_parameters`") # noqa: E501 # verify the required parameter 'required_boolean_group' is set - if self.api_client.client_side_validation and ('required_boolean_group' not in local_var_params or # noqa: E501 - local_var_params['required_boolean_group'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('required_boolean_group') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `required_boolean_group` when calling `test_group_parameters`") # noqa: E501 # verify the required parameter 'required_int64_group' is set - if self.api_client.client_side_validation and ('required_int64_group' not in local_var_params or # noqa: E501 - local_var_params['required_int64_group'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('required_int64_group') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `required_int64_group` when calling `test_group_parameters`") # noqa: E501 collection_formats = {} @@ -1740,13 +1728,13 @@ class FakeApi(object): path_params = {} query_params = [] - if 'required_string_group' in local_var_params and local_var_params['required_string_group'] is not None: # noqa: E501 + if local_var_params.get('required_string_group') is not None: # noqa: E501 query_params.append(('required_string_group', local_var_params['required_string_group'])) # noqa: E501 - if 'required_int64_group' in local_var_params and local_var_params['required_int64_group'] is not None: # noqa: E501 + if local_var_params.get('required_int64_group') is not None: # noqa: E501 query_params.append(('required_int64_group', local_var_params['required_int64_group'])) # noqa: E501 - if 'string_group' in local_var_params and local_var_params['string_group'] is not None: # noqa: E501 + if local_var_params.get('string_group') is not None: # noqa: E501 query_params.append(('string_group', local_var_params['string_group'])) # noqa: E501 - if 'int64_group' in local_var_params and local_var_params['int64_group'] is not None: # noqa: E501 + if local_var_params.get('int64_group') is not None: # noqa: E501 query_params.append(('int64_group', local_var_params['int64_group'])) # noqa: E501 header_params = dict(local_var_params.get('_headers', {})) @@ -1871,8 +1859,7 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'param' is set - if self.api_client.client_side_validation and ('param' not in local_var_params or # noqa: E501 - local_var_params['param'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('param') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `param` when calling `test_inline_additional_properties`") # noqa: E501 collection_formats = {} @@ -2014,12 +2001,10 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'param' is set - if self.api_client.client_side_validation and ('param' not in local_var_params or # noqa: E501 - local_var_params['param'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('param') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `param` when calling `test_json_form_data`") # noqa: E501 # verify the required parameter 'param2' is set - if self.api_client.client_side_validation and ('param2' not in local_var_params or # noqa: E501 - local_var_params['param2'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('param2') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `param2` when calling `test_json_form_data`") # noqa: E501 collection_formats = {} @@ -2180,24 +2165,19 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'pipe' is set - if self.api_client.client_side_validation and ('pipe' not in local_var_params or # noqa: E501 - local_var_params['pipe'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('pipe') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `pipe` when calling `test_query_parameter_collection_format`") # noqa: E501 # verify the required parameter 'ioutil' is set - if self.api_client.client_side_validation and ('ioutil' not in local_var_params or # noqa: E501 - local_var_params['ioutil'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('ioutil') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `ioutil` when calling `test_query_parameter_collection_format`") # noqa: E501 # verify the required parameter 'http' is set - if self.api_client.client_side_validation and ('http' not in local_var_params or # noqa: E501 - local_var_params['http'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('http') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `http` when calling `test_query_parameter_collection_format`") # noqa: E501 # verify the required parameter 'url' is set - if self.api_client.client_side_validation and ('url' not in local_var_params or # noqa: E501 - local_var_params['url'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('url') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `url` when calling `test_query_parameter_collection_format`") # noqa: E501 # verify the required parameter 'context' is set - if self.api_client.client_side_validation and ('context' not in local_var_params or # noqa: E501 - local_var_params['context'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('context') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `context` when calling `test_query_parameter_collection_format`") # noqa: E501 collection_formats = {} @@ -2205,19 +2185,19 @@ class FakeApi(object): path_params = {} query_params = [] - if 'pipe' in local_var_params and local_var_params['pipe'] is not None: # noqa: E501 + if local_var_params.get('pipe') is not None: # noqa: E501 query_params.append(('pipe', local_var_params['pipe'])) # noqa: E501 collection_formats['pipe'] = 'csv' # noqa: E501 - if 'ioutil' in local_var_params and local_var_params['ioutil'] is not None: # noqa: E501 + if local_var_params.get('ioutil') is not None: # noqa: E501 query_params.append(('ioutil', local_var_params['ioutil'])) # noqa: E501 collection_formats['ioutil'] = 'csv' # noqa: E501 - if 'http' in local_var_params and local_var_params['http'] is not None: # noqa: E501 + if local_var_params.get('http') is not None: # noqa: E501 query_params.append(('http', local_var_params['http'])) # noqa: E501 collection_formats['http'] = 'ssv' # noqa: E501 - if 'url' in local_var_params and local_var_params['url'] is not None: # noqa: E501 + if local_var_params.get('url') is not None: # noqa: E501 query_params.append(('url', local_var_params['url'])) # noqa: E501 collection_formats['url'] = 'csv' # noqa: E501 - if 'context' in local_var_params and local_var_params['context'] is not None: # noqa: E501 + if local_var_params.get('context') is not None: # noqa: E501 query_params.append(('context', local_var_params['context'])) # noqa: E501 collection_formats['context'] = 'multi' # noqa: E501 diff --git a/samples/client/petstore/python-asyncio/petstore_api/api/fake_classname_tags123_api.py b/samples/client/petstore/python-asyncio/petstore_api/api/fake_classname_tags123_api.py index 9934eee075398c9b9c7789cbf456de6afd88061c..7dd05dd2d3dca61045a00b5b230238fd3250135c 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/api/fake_classname_tags123_api.py +++ b/samples/client/petstore/python-asyncio/petstore_api/api/fake_classname_tags123_api.py @@ -128,8 +128,7 @@ class FakeClassnameTags123Api(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'body' is set - if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 - local_var_params['body'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `test_classname`") # noqa: E501 collection_formats = {} diff --git a/samples/client/petstore/python-asyncio/petstore_api/api/pet_api.py b/samples/client/petstore/python-asyncio/petstore_api/api/pet_api.py index da2a084682b18f51d766b12195fcf6b93bb84c5e..b2cf9e3641cd9cb2c031f46a1149605160ad1436 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/api/pet_api.py +++ b/samples/client/petstore/python-asyncio/petstore_api/api/pet_api.py @@ -126,8 +126,7 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'body' is set - if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 - local_var_params['body'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `add_pet`") # noqa: E501 collection_formats = {} @@ -269,8 +268,7 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'pet_id' is set - if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501 - local_var_params['pet_id'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('pet_id') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `pet_id` when calling `delete_pet`") # noqa: E501 collection_formats = {} @@ -403,8 +401,7 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'status' is set - if self.api_client.client_side_validation and ('status' not in local_var_params or # noqa: E501 - local_var_params['status'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('status') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `status` when calling `find_pets_by_status`") # noqa: E501 collection_formats = {} @@ -412,7 +409,7 @@ class PetApi(object): path_params = {} query_params = [] - if 'status' in local_var_params and local_var_params['status'] is not None: # noqa: E501 + if local_var_params.get('status') is not None: # noqa: E501 query_params.append(('status', local_var_params['status'])) # noqa: E501 collection_formats['status'] = 'csv' # noqa: E501 @@ -543,8 +540,7 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'tags' is set - if self.api_client.client_side_validation and ('tags' not in local_var_params or # noqa: E501 - local_var_params['tags'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('tags') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `tags` when calling `find_pets_by_tags`") # noqa: E501 collection_formats = {} @@ -552,7 +548,7 @@ class PetApi(object): path_params = {} query_params = [] - if 'tags' in local_var_params and local_var_params['tags'] is not None: # noqa: E501 + if local_var_params.get('tags') is not None: # noqa: E501 query_params.append(('tags', local_var_params['tags'])) # noqa: E501 collection_formats['tags'] = 'csv' # noqa: E501 @@ -683,8 +679,7 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'pet_id' is set - if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501 - local_var_params['pet_id'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('pet_id') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `pet_id` when calling `get_pet_by_id`") # noqa: E501 collection_formats = {} @@ -821,8 +816,7 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'body' is set - if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 - local_var_params['body'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `update_pet`") # noqa: E501 collection_formats = {} @@ -969,8 +963,7 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'pet_id' is set - if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501 - local_var_params['pet_id'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('pet_id') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `pet_id` when calling `update_pet_with_form`") # noqa: E501 collection_formats = {} @@ -1121,8 +1114,7 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'pet_id' is set - if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501 - local_var_params['pet_id'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('pet_id') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `pet_id` when calling `upload_file`") # noqa: E501 collection_formats = {} @@ -1279,12 +1271,10 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'pet_id' is set - if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501 - local_var_params['pet_id'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('pet_id') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `pet_id` when calling `upload_file_with_required_file`") # noqa: E501 # verify the required parameter 'required_file' is set - if self.api_client.client_side_validation and ('required_file' not in local_var_params or # noqa: E501 - local_var_params['required_file'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('required_file') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `required_file` when calling `upload_file_with_required_file`") # noqa: E501 collection_formats = {} diff --git a/samples/client/petstore/python-asyncio/petstore_api/api/store_api.py b/samples/client/petstore/python-asyncio/petstore_api/api/store_api.py index 93566fdb1d6e7514940dde043072aca10b1415c7..4fa17d350ebf205411362644720ac42452fc0301 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/api/store_api.py +++ b/samples/client/petstore/python-asyncio/petstore_api/api/store_api.py @@ -128,8 +128,7 @@ class StoreApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'order_id' is set - if self.api_client.client_side_validation and ('order_id' not in local_var_params or # noqa: E501 - local_var_params['order_id'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('order_id') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `order_id` when calling `delete_order`") # noqa: E501 collection_formats = {} @@ -387,8 +386,7 @@ class StoreApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'order_id' is set - if self.api_client.client_side_validation and ('order_id' not in local_var_params or # noqa: E501 - local_var_params['order_id'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('order_id') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `order_id` when calling `get_order_by_id`") # noqa: E501 if self.api_client.client_side_validation and 'order_id' in local_var_params and local_var_params['order_id'] > 5: # noqa: E501 @@ -529,8 +527,7 @@ class StoreApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'body' is set - if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 - local_var_params['body'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `place_order`") # noqa: E501 collection_formats = {} diff --git a/samples/client/petstore/python-asyncio/petstore_api/api/user_api.py b/samples/client/petstore/python-asyncio/petstore_api/api/user_api.py index 550d852e0c2d568ecc965f1648620b783ac8ea0c..29e66939d7379f374d8e8bb5081a9e6513d17a90 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/api/user_api.py +++ b/samples/client/petstore/python-asyncio/petstore_api/api/user_api.py @@ -128,8 +128,7 @@ class UserApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'body' is set - if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 - local_var_params['body'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `create_user`") # noqa: E501 collection_formats = {} @@ -258,8 +257,7 @@ class UserApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'body' is set - if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 - local_var_params['body'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `create_users_with_array_input`") # noqa: E501 collection_formats = {} @@ -388,8 +386,7 @@ class UserApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'body' is set - if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 - local_var_params['body'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `create_users_with_list_input`") # noqa: E501 collection_formats = {} @@ -520,8 +517,7 @@ class UserApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'username' is set - if self.api_client.client_side_validation and ('username' not in local_var_params or # noqa: E501 - local_var_params['username'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('username') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `username` when calling `delete_user`") # noqa: E501 collection_formats = {} @@ -650,8 +646,7 @@ class UserApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'username' is set - if self.api_client.client_side_validation and ('username' not in local_var_params or # noqa: E501 - local_var_params['username'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('username') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `username` when calling `get_user_by_name`") # noqa: E501 collection_formats = {} @@ -793,12 +788,10 @@ class UserApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'username' is set - if self.api_client.client_side_validation and ('username' not in local_var_params or # noqa: E501 - local_var_params['username'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('username') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `username` when calling `login_user`") # noqa: E501 # verify the required parameter 'password' is set - if self.api_client.client_side_validation and ('password' not in local_var_params or # noqa: E501 - local_var_params['password'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('password') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `password` when calling `login_user`") # noqa: E501 collection_formats = {} @@ -806,9 +799,9 @@ class UserApi(object): path_params = {} query_params = [] - if 'username' in local_var_params and local_var_params['username'] is not None: # noqa: E501 + if local_var_params.get('username') is not None: # noqa: E501 query_params.append(('username', local_var_params['username'])) # noqa: E501 - if 'password' in local_var_params and local_var_params['password'] is not None: # noqa: E501 + if local_var_params.get('password') is not None: # noqa: E501 query_params.append(('password', local_var_params['password'])) # noqa: E501 header_params = dict(local_var_params.get('_headers', {})) @@ -1062,12 +1055,10 @@ class UserApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'username' is set - if self.api_client.client_side_validation and ('username' not in local_var_params or # noqa: E501 - local_var_params['username'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('username') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `username` when calling `update_user`") # noqa: E501 # verify the required parameter 'body' is set - if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 - local_var_params['body'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `update_user`") # noqa: E501 collection_formats = {} diff --git a/samples/client/petstore/python-legacy/petstore_api/api/another_fake_api.py b/samples/client/petstore/python-legacy/petstore_api/api/another_fake_api.py index 9f56ecf401d547ef9e41530e2688789b4b766772..8719c9511f1728190fa3799de3a477df85e3d7b8 100644 --- a/samples/client/petstore/python-legacy/petstore_api/api/another_fake_api.py +++ b/samples/client/petstore/python-legacy/petstore_api/api/another_fake_api.py @@ -128,8 +128,7 @@ class AnotherFakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'body' is set - if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 - local_var_params['body'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `call_123_test_special_tags`") # noqa: E501 collection_formats = {} diff --git a/samples/client/petstore/python-legacy/petstore_api/api/fake_api.py b/samples/client/petstore/python-legacy/petstore_api/api/fake_api.py index 24fe364a0bde47a7896a7597ace3fe56200fd58c..d76ff0a0676c15ea7e3a978bef2f904aabc7bebe 100644 --- a/samples/client/petstore/python-legacy/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python-legacy/petstore_api/api/fake_api.py @@ -128,8 +128,7 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'xml_item' is set - if self.api_client.client_side_validation and ('xml_item' not in local_var_params or # noqa: E501 - local_var_params['xml_item'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('xml_item') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `xml_item` when calling `create_xml_item`") # noqa: E501 collection_formats = {} @@ -804,8 +803,7 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'body' is set - if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 - local_var_params['body'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `test_body_with_file_schema`") # noqa: E501 collection_formats = {} @@ -947,12 +945,10 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'query' is set - if self.api_client.client_side_validation and ('query' not in local_var_params or # noqa: E501 - local_var_params['query'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('query') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `query` when calling `test_body_with_query_params`") # noqa: E501 # verify the required parameter 'body' is set - if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 - local_var_params['body'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `test_body_with_query_params`") # noqa: E501 collection_formats = {} @@ -960,7 +956,7 @@ class FakeApi(object): path_params = {} query_params = [] - if 'query' in local_var_params and local_var_params['query'] is not None: # noqa: E501 + if local_var_params.get('query') is not None: # noqa: E501 query_params.append(('query', local_var_params['query'])) # noqa: E501 header_params = dict(local_var_params.get('_headers', {})) @@ -1093,8 +1089,7 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'body' is set - if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 - local_var_params['body'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `test_client_model`") # noqa: E501 collection_formats = {} @@ -1304,20 +1299,16 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'number' is set - if self.api_client.client_side_validation and ('number' not in local_var_params or # noqa: E501 - local_var_params['number'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('number') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `number` when calling `test_endpoint_parameters`") # noqa: E501 # verify the required parameter 'double' is set - if self.api_client.client_side_validation and ('double' not in local_var_params or # noqa: E501 - local_var_params['double'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('double') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `double` when calling `test_endpoint_parameters`") # noqa: E501 # verify the required parameter 'pattern_without_delimiter' is set - if self.api_client.client_side_validation and ('pattern_without_delimiter' not in local_var_params or # noqa: E501 - local_var_params['pattern_without_delimiter'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('pattern_without_delimiter') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`") # noqa: E501 # verify the required parameter 'byte' is set - if self.api_client.client_side_validation and ('byte' not in local_var_params or # noqa: E501 - local_var_params['byte'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('byte') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `byte` when calling `test_endpoint_parameters`") # noqa: E501 if self.api_client.client_side_validation and 'number' in local_var_params and local_var_params['number'] > 543.2: # noqa: E501 @@ -1550,14 +1541,14 @@ class FakeApi(object): path_params = {} query_params = [] - if 'enum_query_string_array' in local_var_params and local_var_params['enum_query_string_array'] is not None: # noqa: E501 + if local_var_params.get('enum_query_string_array') is not None: # noqa: E501 query_params.append(('enum_query_string_array', local_var_params['enum_query_string_array'])) # noqa: E501 collection_formats['enum_query_string_array'] = 'csv' # noqa: E501 - if 'enum_query_string' in local_var_params and local_var_params['enum_query_string'] is not None: # noqa: E501 + if local_var_params.get('enum_query_string') is not None: # noqa: E501 query_params.append(('enum_query_string', local_var_params['enum_query_string'])) # noqa: E501 - if 'enum_query_integer' in local_var_params and local_var_params['enum_query_integer'] is not None: # noqa: E501 + if local_var_params.get('enum_query_integer') is not None: # noqa: E501 query_params.append(('enum_query_integer', local_var_params['enum_query_integer'])) # noqa: E501 - if 'enum_query_double' in local_var_params and local_var_params['enum_query_double'] is not None: # noqa: E501 + if local_var_params.get('enum_query_double') is not None: # noqa: E501 query_params.append(('enum_query_double', local_var_params['enum_query_double'])) # noqa: E501 header_params = dict(local_var_params.get('_headers', {})) @@ -1723,16 +1714,13 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'required_string_group' is set - if self.api_client.client_side_validation and ('required_string_group' not in local_var_params or # noqa: E501 - local_var_params['required_string_group'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('required_string_group') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `required_string_group` when calling `test_group_parameters`") # noqa: E501 # verify the required parameter 'required_boolean_group' is set - if self.api_client.client_side_validation and ('required_boolean_group' not in local_var_params or # noqa: E501 - local_var_params['required_boolean_group'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('required_boolean_group') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `required_boolean_group` when calling `test_group_parameters`") # noqa: E501 # verify the required parameter 'required_int64_group' is set - if self.api_client.client_side_validation and ('required_int64_group' not in local_var_params or # noqa: E501 - local_var_params['required_int64_group'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('required_int64_group') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `required_int64_group` when calling `test_group_parameters`") # noqa: E501 collection_formats = {} @@ -1740,13 +1728,13 @@ class FakeApi(object): path_params = {} query_params = [] - if 'required_string_group' in local_var_params and local_var_params['required_string_group'] is not None: # noqa: E501 + if local_var_params.get('required_string_group') is not None: # noqa: E501 query_params.append(('required_string_group', local_var_params['required_string_group'])) # noqa: E501 - if 'required_int64_group' in local_var_params and local_var_params['required_int64_group'] is not None: # noqa: E501 + if local_var_params.get('required_int64_group') is not None: # noqa: E501 query_params.append(('required_int64_group', local_var_params['required_int64_group'])) # noqa: E501 - if 'string_group' in local_var_params and local_var_params['string_group'] is not None: # noqa: E501 + if local_var_params.get('string_group') is not None: # noqa: E501 query_params.append(('string_group', local_var_params['string_group'])) # noqa: E501 - if 'int64_group' in local_var_params and local_var_params['int64_group'] is not None: # noqa: E501 + if local_var_params.get('int64_group') is not None: # noqa: E501 query_params.append(('int64_group', local_var_params['int64_group'])) # noqa: E501 header_params = dict(local_var_params.get('_headers', {})) @@ -1871,8 +1859,7 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'param' is set - if self.api_client.client_side_validation and ('param' not in local_var_params or # noqa: E501 - local_var_params['param'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('param') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `param` when calling `test_inline_additional_properties`") # noqa: E501 collection_formats = {} @@ -2014,12 +2001,10 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'param' is set - if self.api_client.client_side_validation and ('param' not in local_var_params or # noqa: E501 - local_var_params['param'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('param') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `param` when calling `test_json_form_data`") # noqa: E501 # verify the required parameter 'param2' is set - if self.api_client.client_side_validation and ('param2' not in local_var_params or # noqa: E501 - local_var_params['param2'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('param2') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `param2` when calling `test_json_form_data`") # noqa: E501 collection_formats = {} @@ -2180,24 +2165,19 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'pipe' is set - if self.api_client.client_side_validation and ('pipe' not in local_var_params or # noqa: E501 - local_var_params['pipe'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('pipe') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `pipe` when calling `test_query_parameter_collection_format`") # noqa: E501 # verify the required parameter 'ioutil' is set - if self.api_client.client_side_validation and ('ioutil' not in local_var_params or # noqa: E501 - local_var_params['ioutil'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('ioutil') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `ioutil` when calling `test_query_parameter_collection_format`") # noqa: E501 # verify the required parameter 'http' is set - if self.api_client.client_side_validation and ('http' not in local_var_params or # noqa: E501 - local_var_params['http'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('http') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `http` when calling `test_query_parameter_collection_format`") # noqa: E501 # verify the required parameter 'url' is set - if self.api_client.client_side_validation and ('url' not in local_var_params or # noqa: E501 - local_var_params['url'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('url') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `url` when calling `test_query_parameter_collection_format`") # noqa: E501 # verify the required parameter 'context' is set - if self.api_client.client_side_validation and ('context' not in local_var_params or # noqa: E501 - local_var_params['context'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('context') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `context` when calling `test_query_parameter_collection_format`") # noqa: E501 collection_formats = {} @@ -2205,19 +2185,19 @@ class FakeApi(object): path_params = {} query_params = [] - if 'pipe' in local_var_params and local_var_params['pipe'] is not None: # noqa: E501 + if local_var_params.get('pipe') is not None: # noqa: E501 query_params.append(('pipe', local_var_params['pipe'])) # noqa: E501 collection_formats['pipe'] = 'csv' # noqa: E501 - if 'ioutil' in local_var_params and local_var_params['ioutil'] is not None: # noqa: E501 + if local_var_params.get('ioutil') is not None: # noqa: E501 query_params.append(('ioutil', local_var_params['ioutil'])) # noqa: E501 collection_formats['ioutil'] = 'csv' # noqa: E501 - if 'http' in local_var_params and local_var_params['http'] is not None: # noqa: E501 + if local_var_params.get('http') is not None: # noqa: E501 query_params.append(('http', local_var_params['http'])) # noqa: E501 collection_formats['http'] = 'ssv' # noqa: E501 - if 'url' in local_var_params and local_var_params['url'] is not None: # noqa: E501 + if local_var_params.get('url') is not None: # noqa: E501 query_params.append(('url', local_var_params['url'])) # noqa: E501 collection_formats['url'] = 'csv' # noqa: E501 - if 'context' in local_var_params and local_var_params['context'] is not None: # noqa: E501 + if local_var_params.get('context') is not None: # noqa: E501 query_params.append(('context', local_var_params['context'])) # noqa: E501 collection_formats['context'] = 'multi' # noqa: E501 diff --git a/samples/client/petstore/python-legacy/petstore_api/api/fake_classname_tags123_api.py b/samples/client/petstore/python-legacy/petstore_api/api/fake_classname_tags123_api.py index 9934eee075398c9b9c7789cbf456de6afd88061c..7dd05dd2d3dca61045a00b5b230238fd3250135c 100644 --- a/samples/client/petstore/python-legacy/petstore_api/api/fake_classname_tags123_api.py +++ b/samples/client/petstore/python-legacy/petstore_api/api/fake_classname_tags123_api.py @@ -128,8 +128,7 @@ class FakeClassnameTags123Api(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'body' is set - if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 - local_var_params['body'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `test_classname`") # noqa: E501 collection_formats = {} diff --git a/samples/client/petstore/python-legacy/petstore_api/api/pet_api.py b/samples/client/petstore/python-legacy/petstore_api/api/pet_api.py index da2a084682b18f51d766b12195fcf6b93bb84c5e..b2cf9e3641cd9cb2c031f46a1149605160ad1436 100644 --- a/samples/client/petstore/python-legacy/petstore_api/api/pet_api.py +++ b/samples/client/petstore/python-legacy/petstore_api/api/pet_api.py @@ -126,8 +126,7 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'body' is set - if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 - local_var_params['body'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `add_pet`") # noqa: E501 collection_formats = {} @@ -269,8 +268,7 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'pet_id' is set - if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501 - local_var_params['pet_id'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('pet_id') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `pet_id` when calling `delete_pet`") # noqa: E501 collection_formats = {} @@ -403,8 +401,7 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'status' is set - if self.api_client.client_side_validation and ('status' not in local_var_params or # noqa: E501 - local_var_params['status'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('status') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `status` when calling `find_pets_by_status`") # noqa: E501 collection_formats = {} @@ -412,7 +409,7 @@ class PetApi(object): path_params = {} query_params = [] - if 'status' in local_var_params and local_var_params['status'] is not None: # noqa: E501 + if local_var_params.get('status') is not None: # noqa: E501 query_params.append(('status', local_var_params['status'])) # noqa: E501 collection_formats['status'] = 'csv' # noqa: E501 @@ -543,8 +540,7 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'tags' is set - if self.api_client.client_side_validation and ('tags' not in local_var_params or # noqa: E501 - local_var_params['tags'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('tags') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `tags` when calling `find_pets_by_tags`") # noqa: E501 collection_formats = {} @@ -552,7 +548,7 @@ class PetApi(object): path_params = {} query_params = [] - if 'tags' in local_var_params and local_var_params['tags'] is not None: # noqa: E501 + if local_var_params.get('tags') is not None: # noqa: E501 query_params.append(('tags', local_var_params['tags'])) # noqa: E501 collection_formats['tags'] = 'csv' # noqa: E501 @@ -683,8 +679,7 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'pet_id' is set - if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501 - local_var_params['pet_id'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('pet_id') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `pet_id` when calling `get_pet_by_id`") # noqa: E501 collection_formats = {} @@ -821,8 +816,7 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'body' is set - if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 - local_var_params['body'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `update_pet`") # noqa: E501 collection_formats = {} @@ -969,8 +963,7 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'pet_id' is set - if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501 - local_var_params['pet_id'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('pet_id') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `pet_id` when calling `update_pet_with_form`") # noqa: E501 collection_formats = {} @@ -1121,8 +1114,7 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'pet_id' is set - if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501 - local_var_params['pet_id'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('pet_id') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `pet_id` when calling `upload_file`") # noqa: E501 collection_formats = {} @@ -1279,12 +1271,10 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'pet_id' is set - if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501 - local_var_params['pet_id'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('pet_id') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `pet_id` when calling `upload_file_with_required_file`") # noqa: E501 # verify the required parameter 'required_file' is set - if self.api_client.client_side_validation and ('required_file' not in local_var_params or # noqa: E501 - local_var_params['required_file'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('required_file') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `required_file` when calling `upload_file_with_required_file`") # noqa: E501 collection_formats = {} diff --git a/samples/client/petstore/python-legacy/petstore_api/api/store_api.py b/samples/client/petstore/python-legacy/petstore_api/api/store_api.py index 93566fdb1d6e7514940dde043072aca10b1415c7..4fa17d350ebf205411362644720ac42452fc0301 100644 --- a/samples/client/petstore/python-legacy/petstore_api/api/store_api.py +++ b/samples/client/petstore/python-legacy/petstore_api/api/store_api.py @@ -128,8 +128,7 @@ class StoreApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'order_id' is set - if self.api_client.client_side_validation and ('order_id' not in local_var_params or # noqa: E501 - local_var_params['order_id'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('order_id') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `order_id` when calling `delete_order`") # noqa: E501 collection_formats = {} @@ -387,8 +386,7 @@ class StoreApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'order_id' is set - if self.api_client.client_side_validation and ('order_id' not in local_var_params or # noqa: E501 - local_var_params['order_id'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('order_id') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `order_id` when calling `get_order_by_id`") # noqa: E501 if self.api_client.client_side_validation and 'order_id' in local_var_params and local_var_params['order_id'] > 5: # noqa: E501 @@ -529,8 +527,7 @@ class StoreApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'body' is set - if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 - local_var_params['body'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `place_order`") # noqa: E501 collection_formats = {} diff --git a/samples/client/petstore/python-legacy/petstore_api/api/user_api.py b/samples/client/petstore/python-legacy/petstore_api/api/user_api.py index 550d852e0c2d568ecc965f1648620b783ac8ea0c..29e66939d7379f374d8e8bb5081a9e6513d17a90 100644 --- a/samples/client/petstore/python-legacy/petstore_api/api/user_api.py +++ b/samples/client/petstore/python-legacy/petstore_api/api/user_api.py @@ -128,8 +128,7 @@ class UserApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'body' is set - if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 - local_var_params['body'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `create_user`") # noqa: E501 collection_formats = {} @@ -258,8 +257,7 @@ class UserApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'body' is set - if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 - local_var_params['body'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `create_users_with_array_input`") # noqa: E501 collection_formats = {} @@ -388,8 +386,7 @@ class UserApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'body' is set - if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 - local_var_params['body'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `create_users_with_list_input`") # noqa: E501 collection_formats = {} @@ -520,8 +517,7 @@ class UserApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'username' is set - if self.api_client.client_side_validation and ('username' not in local_var_params or # noqa: E501 - local_var_params['username'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('username') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `username` when calling `delete_user`") # noqa: E501 collection_formats = {} @@ -650,8 +646,7 @@ class UserApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'username' is set - if self.api_client.client_side_validation and ('username' not in local_var_params or # noqa: E501 - local_var_params['username'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('username') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `username` when calling `get_user_by_name`") # noqa: E501 collection_formats = {} @@ -793,12 +788,10 @@ class UserApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'username' is set - if self.api_client.client_side_validation and ('username' not in local_var_params or # noqa: E501 - local_var_params['username'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('username') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `username` when calling `login_user`") # noqa: E501 # verify the required parameter 'password' is set - if self.api_client.client_side_validation and ('password' not in local_var_params or # noqa: E501 - local_var_params['password'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('password') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `password` when calling `login_user`") # noqa: E501 collection_formats = {} @@ -806,9 +799,9 @@ class UserApi(object): path_params = {} query_params = [] - if 'username' in local_var_params and local_var_params['username'] is not None: # noqa: E501 + if local_var_params.get('username') is not None: # noqa: E501 query_params.append(('username', local_var_params['username'])) # noqa: E501 - if 'password' in local_var_params and local_var_params['password'] is not None: # noqa: E501 + if local_var_params.get('password') is not None: # noqa: E501 query_params.append(('password', local_var_params['password'])) # noqa: E501 header_params = dict(local_var_params.get('_headers', {})) @@ -1062,12 +1055,10 @@ class UserApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'username' is set - if self.api_client.client_side_validation and ('username' not in local_var_params or # noqa: E501 - local_var_params['username'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('username') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `username` when calling `update_user`") # noqa: E501 # verify the required parameter 'body' is set - if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 - local_var_params['body'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `update_user`") # noqa: E501 collection_formats = {} diff --git a/samples/client/petstore/python-tornado/petstore_api/api/another_fake_api.py b/samples/client/petstore/python-tornado/petstore_api/api/another_fake_api.py index 9f56ecf401d547ef9e41530e2688789b4b766772..8719c9511f1728190fa3799de3a477df85e3d7b8 100644 --- a/samples/client/petstore/python-tornado/petstore_api/api/another_fake_api.py +++ b/samples/client/petstore/python-tornado/petstore_api/api/another_fake_api.py @@ -128,8 +128,7 @@ class AnotherFakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'body' is set - if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 - local_var_params['body'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `call_123_test_special_tags`") # noqa: E501 collection_formats = {} diff --git a/samples/client/petstore/python-tornado/petstore_api/api/fake_api.py b/samples/client/petstore/python-tornado/petstore_api/api/fake_api.py index 24fe364a0bde47a7896a7597ace3fe56200fd58c..d76ff0a0676c15ea7e3a978bef2f904aabc7bebe 100644 --- a/samples/client/petstore/python-tornado/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python-tornado/petstore_api/api/fake_api.py @@ -128,8 +128,7 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'xml_item' is set - if self.api_client.client_side_validation and ('xml_item' not in local_var_params or # noqa: E501 - local_var_params['xml_item'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('xml_item') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `xml_item` when calling `create_xml_item`") # noqa: E501 collection_formats = {} @@ -804,8 +803,7 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'body' is set - if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 - local_var_params['body'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `test_body_with_file_schema`") # noqa: E501 collection_formats = {} @@ -947,12 +945,10 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'query' is set - if self.api_client.client_side_validation and ('query' not in local_var_params or # noqa: E501 - local_var_params['query'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('query') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `query` when calling `test_body_with_query_params`") # noqa: E501 # verify the required parameter 'body' is set - if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 - local_var_params['body'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `test_body_with_query_params`") # noqa: E501 collection_formats = {} @@ -960,7 +956,7 @@ class FakeApi(object): path_params = {} query_params = [] - if 'query' in local_var_params and local_var_params['query'] is not None: # noqa: E501 + if local_var_params.get('query') is not None: # noqa: E501 query_params.append(('query', local_var_params['query'])) # noqa: E501 header_params = dict(local_var_params.get('_headers', {})) @@ -1093,8 +1089,7 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'body' is set - if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 - local_var_params['body'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `test_client_model`") # noqa: E501 collection_formats = {} @@ -1304,20 +1299,16 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'number' is set - if self.api_client.client_side_validation and ('number' not in local_var_params or # noqa: E501 - local_var_params['number'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('number') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `number` when calling `test_endpoint_parameters`") # noqa: E501 # verify the required parameter 'double' is set - if self.api_client.client_side_validation and ('double' not in local_var_params or # noqa: E501 - local_var_params['double'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('double') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `double` when calling `test_endpoint_parameters`") # noqa: E501 # verify the required parameter 'pattern_without_delimiter' is set - if self.api_client.client_side_validation and ('pattern_without_delimiter' not in local_var_params or # noqa: E501 - local_var_params['pattern_without_delimiter'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('pattern_without_delimiter') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`") # noqa: E501 # verify the required parameter 'byte' is set - if self.api_client.client_side_validation and ('byte' not in local_var_params or # noqa: E501 - local_var_params['byte'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('byte') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `byte` when calling `test_endpoint_parameters`") # noqa: E501 if self.api_client.client_side_validation and 'number' in local_var_params and local_var_params['number'] > 543.2: # noqa: E501 @@ -1550,14 +1541,14 @@ class FakeApi(object): path_params = {} query_params = [] - if 'enum_query_string_array' in local_var_params and local_var_params['enum_query_string_array'] is not None: # noqa: E501 + if local_var_params.get('enum_query_string_array') is not None: # noqa: E501 query_params.append(('enum_query_string_array', local_var_params['enum_query_string_array'])) # noqa: E501 collection_formats['enum_query_string_array'] = 'csv' # noqa: E501 - if 'enum_query_string' in local_var_params and local_var_params['enum_query_string'] is not None: # noqa: E501 + if local_var_params.get('enum_query_string') is not None: # noqa: E501 query_params.append(('enum_query_string', local_var_params['enum_query_string'])) # noqa: E501 - if 'enum_query_integer' in local_var_params and local_var_params['enum_query_integer'] is not None: # noqa: E501 + if local_var_params.get('enum_query_integer') is not None: # noqa: E501 query_params.append(('enum_query_integer', local_var_params['enum_query_integer'])) # noqa: E501 - if 'enum_query_double' in local_var_params and local_var_params['enum_query_double'] is not None: # noqa: E501 + if local_var_params.get('enum_query_double') is not None: # noqa: E501 query_params.append(('enum_query_double', local_var_params['enum_query_double'])) # noqa: E501 header_params = dict(local_var_params.get('_headers', {})) @@ -1723,16 +1714,13 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'required_string_group' is set - if self.api_client.client_side_validation and ('required_string_group' not in local_var_params or # noqa: E501 - local_var_params['required_string_group'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('required_string_group') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `required_string_group` when calling `test_group_parameters`") # noqa: E501 # verify the required parameter 'required_boolean_group' is set - if self.api_client.client_side_validation and ('required_boolean_group' not in local_var_params or # noqa: E501 - local_var_params['required_boolean_group'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('required_boolean_group') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `required_boolean_group` when calling `test_group_parameters`") # noqa: E501 # verify the required parameter 'required_int64_group' is set - if self.api_client.client_side_validation and ('required_int64_group' not in local_var_params or # noqa: E501 - local_var_params['required_int64_group'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('required_int64_group') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `required_int64_group` when calling `test_group_parameters`") # noqa: E501 collection_formats = {} @@ -1740,13 +1728,13 @@ class FakeApi(object): path_params = {} query_params = [] - if 'required_string_group' in local_var_params and local_var_params['required_string_group'] is not None: # noqa: E501 + if local_var_params.get('required_string_group') is not None: # noqa: E501 query_params.append(('required_string_group', local_var_params['required_string_group'])) # noqa: E501 - if 'required_int64_group' in local_var_params and local_var_params['required_int64_group'] is not None: # noqa: E501 + if local_var_params.get('required_int64_group') is not None: # noqa: E501 query_params.append(('required_int64_group', local_var_params['required_int64_group'])) # noqa: E501 - if 'string_group' in local_var_params and local_var_params['string_group'] is not None: # noqa: E501 + if local_var_params.get('string_group') is not None: # noqa: E501 query_params.append(('string_group', local_var_params['string_group'])) # noqa: E501 - if 'int64_group' in local_var_params and local_var_params['int64_group'] is not None: # noqa: E501 + if local_var_params.get('int64_group') is not None: # noqa: E501 query_params.append(('int64_group', local_var_params['int64_group'])) # noqa: E501 header_params = dict(local_var_params.get('_headers', {})) @@ -1871,8 +1859,7 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'param' is set - if self.api_client.client_side_validation and ('param' not in local_var_params or # noqa: E501 - local_var_params['param'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('param') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `param` when calling `test_inline_additional_properties`") # noqa: E501 collection_formats = {} @@ -2014,12 +2001,10 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'param' is set - if self.api_client.client_side_validation and ('param' not in local_var_params or # noqa: E501 - local_var_params['param'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('param') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `param` when calling `test_json_form_data`") # noqa: E501 # verify the required parameter 'param2' is set - if self.api_client.client_side_validation and ('param2' not in local_var_params or # noqa: E501 - local_var_params['param2'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('param2') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `param2` when calling `test_json_form_data`") # noqa: E501 collection_formats = {} @@ -2180,24 +2165,19 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'pipe' is set - if self.api_client.client_side_validation and ('pipe' not in local_var_params or # noqa: E501 - local_var_params['pipe'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('pipe') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `pipe` when calling `test_query_parameter_collection_format`") # noqa: E501 # verify the required parameter 'ioutil' is set - if self.api_client.client_side_validation and ('ioutil' not in local_var_params or # noqa: E501 - local_var_params['ioutil'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('ioutil') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `ioutil` when calling `test_query_parameter_collection_format`") # noqa: E501 # verify the required parameter 'http' is set - if self.api_client.client_side_validation and ('http' not in local_var_params or # noqa: E501 - local_var_params['http'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('http') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `http` when calling `test_query_parameter_collection_format`") # noqa: E501 # verify the required parameter 'url' is set - if self.api_client.client_side_validation and ('url' not in local_var_params or # noqa: E501 - local_var_params['url'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('url') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `url` when calling `test_query_parameter_collection_format`") # noqa: E501 # verify the required parameter 'context' is set - if self.api_client.client_side_validation and ('context' not in local_var_params or # noqa: E501 - local_var_params['context'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('context') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `context` when calling `test_query_parameter_collection_format`") # noqa: E501 collection_formats = {} @@ -2205,19 +2185,19 @@ class FakeApi(object): path_params = {} query_params = [] - if 'pipe' in local_var_params and local_var_params['pipe'] is not None: # noqa: E501 + if local_var_params.get('pipe') is not None: # noqa: E501 query_params.append(('pipe', local_var_params['pipe'])) # noqa: E501 collection_formats['pipe'] = 'csv' # noqa: E501 - if 'ioutil' in local_var_params and local_var_params['ioutil'] is not None: # noqa: E501 + if local_var_params.get('ioutil') is not None: # noqa: E501 query_params.append(('ioutil', local_var_params['ioutil'])) # noqa: E501 collection_formats['ioutil'] = 'csv' # noqa: E501 - if 'http' in local_var_params and local_var_params['http'] is not None: # noqa: E501 + if local_var_params.get('http') is not None: # noqa: E501 query_params.append(('http', local_var_params['http'])) # noqa: E501 collection_formats['http'] = 'ssv' # noqa: E501 - if 'url' in local_var_params and local_var_params['url'] is not None: # noqa: E501 + if local_var_params.get('url') is not None: # noqa: E501 query_params.append(('url', local_var_params['url'])) # noqa: E501 collection_formats['url'] = 'csv' # noqa: E501 - if 'context' in local_var_params and local_var_params['context'] is not None: # noqa: E501 + if local_var_params.get('context') is not None: # noqa: E501 query_params.append(('context', local_var_params['context'])) # noqa: E501 collection_formats['context'] = 'multi' # noqa: E501 diff --git a/samples/client/petstore/python-tornado/petstore_api/api/fake_classname_tags123_api.py b/samples/client/petstore/python-tornado/petstore_api/api/fake_classname_tags123_api.py index 9934eee075398c9b9c7789cbf456de6afd88061c..7dd05dd2d3dca61045a00b5b230238fd3250135c 100644 --- a/samples/client/petstore/python-tornado/petstore_api/api/fake_classname_tags123_api.py +++ b/samples/client/petstore/python-tornado/petstore_api/api/fake_classname_tags123_api.py @@ -128,8 +128,7 @@ class FakeClassnameTags123Api(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'body' is set - if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 - local_var_params['body'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `test_classname`") # noqa: E501 collection_formats = {} diff --git a/samples/client/petstore/python-tornado/petstore_api/api/pet_api.py b/samples/client/petstore/python-tornado/petstore_api/api/pet_api.py index da2a084682b18f51d766b12195fcf6b93bb84c5e..b2cf9e3641cd9cb2c031f46a1149605160ad1436 100644 --- a/samples/client/petstore/python-tornado/petstore_api/api/pet_api.py +++ b/samples/client/petstore/python-tornado/petstore_api/api/pet_api.py @@ -126,8 +126,7 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'body' is set - if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 - local_var_params['body'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `add_pet`") # noqa: E501 collection_formats = {} @@ -269,8 +268,7 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'pet_id' is set - if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501 - local_var_params['pet_id'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('pet_id') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `pet_id` when calling `delete_pet`") # noqa: E501 collection_formats = {} @@ -403,8 +401,7 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'status' is set - if self.api_client.client_side_validation and ('status' not in local_var_params or # noqa: E501 - local_var_params['status'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('status') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `status` when calling `find_pets_by_status`") # noqa: E501 collection_formats = {} @@ -412,7 +409,7 @@ class PetApi(object): path_params = {} query_params = [] - if 'status' in local_var_params and local_var_params['status'] is not None: # noqa: E501 + if local_var_params.get('status') is not None: # noqa: E501 query_params.append(('status', local_var_params['status'])) # noqa: E501 collection_formats['status'] = 'csv' # noqa: E501 @@ -543,8 +540,7 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'tags' is set - if self.api_client.client_side_validation and ('tags' not in local_var_params or # noqa: E501 - local_var_params['tags'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('tags') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `tags` when calling `find_pets_by_tags`") # noqa: E501 collection_formats = {} @@ -552,7 +548,7 @@ class PetApi(object): path_params = {} query_params = [] - if 'tags' in local_var_params and local_var_params['tags'] is not None: # noqa: E501 + if local_var_params.get('tags') is not None: # noqa: E501 query_params.append(('tags', local_var_params['tags'])) # noqa: E501 collection_formats['tags'] = 'csv' # noqa: E501 @@ -683,8 +679,7 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'pet_id' is set - if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501 - local_var_params['pet_id'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('pet_id') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `pet_id` when calling `get_pet_by_id`") # noqa: E501 collection_formats = {} @@ -821,8 +816,7 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'body' is set - if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 - local_var_params['body'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `update_pet`") # noqa: E501 collection_formats = {} @@ -969,8 +963,7 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'pet_id' is set - if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501 - local_var_params['pet_id'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('pet_id') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `pet_id` when calling `update_pet_with_form`") # noqa: E501 collection_formats = {} @@ -1121,8 +1114,7 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'pet_id' is set - if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501 - local_var_params['pet_id'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('pet_id') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `pet_id` when calling `upload_file`") # noqa: E501 collection_formats = {} @@ -1279,12 +1271,10 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'pet_id' is set - if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501 - local_var_params['pet_id'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('pet_id') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `pet_id` when calling `upload_file_with_required_file`") # noqa: E501 # verify the required parameter 'required_file' is set - if self.api_client.client_side_validation and ('required_file' not in local_var_params or # noqa: E501 - local_var_params['required_file'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('required_file') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `required_file` when calling `upload_file_with_required_file`") # noqa: E501 collection_formats = {} diff --git a/samples/client/petstore/python-tornado/petstore_api/api/store_api.py b/samples/client/petstore/python-tornado/petstore_api/api/store_api.py index 93566fdb1d6e7514940dde043072aca10b1415c7..4fa17d350ebf205411362644720ac42452fc0301 100644 --- a/samples/client/petstore/python-tornado/petstore_api/api/store_api.py +++ b/samples/client/petstore/python-tornado/petstore_api/api/store_api.py @@ -128,8 +128,7 @@ class StoreApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'order_id' is set - if self.api_client.client_side_validation and ('order_id' not in local_var_params or # noqa: E501 - local_var_params['order_id'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('order_id') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `order_id` when calling `delete_order`") # noqa: E501 collection_formats = {} @@ -387,8 +386,7 @@ class StoreApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'order_id' is set - if self.api_client.client_side_validation and ('order_id' not in local_var_params or # noqa: E501 - local_var_params['order_id'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('order_id') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `order_id` when calling `get_order_by_id`") # noqa: E501 if self.api_client.client_side_validation and 'order_id' in local_var_params and local_var_params['order_id'] > 5: # noqa: E501 @@ -529,8 +527,7 @@ class StoreApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'body' is set - if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 - local_var_params['body'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `place_order`") # noqa: E501 collection_formats = {} diff --git a/samples/client/petstore/python-tornado/petstore_api/api/user_api.py b/samples/client/petstore/python-tornado/petstore_api/api/user_api.py index 550d852e0c2d568ecc965f1648620b783ac8ea0c..29e66939d7379f374d8e8bb5081a9e6513d17a90 100644 --- a/samples/client/petstore/python-tornado/petstore_api/api/user_api.py +++ b/samples/client/petstore/python-tornado/petstore_api/api/user_api.py @@ -128,8 +128,7 @@ class UserApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'body' is set - if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 - local_var_params['body'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `create_user`") # noqa: E501 collection_formats = {} @@ -258,8 +257,7 @@ class UserApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'body' is set - if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 - local_var_params['body'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `create_users_with_array_input`") # noqa: E501 collection_formats = {} @@ -388,8 +386,7 @@ class UserApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'body' is set - if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 - local_var_params['body'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `create_users_with_list_input`") # noqa: E501 collection_formats = {} @@ -520,8 +517,7 @@ class UserApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'username' is set - if self.api_client.client_side_validation and ('username' not in local_var_params or # noqa: E501 - local_var_params['username'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('username') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `username` when calling `delete_user`") # noqa: E501 collection_formats = {} @@ -650,8 +646,7 @@ class UserApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'username' is set - if self.api_client.client_side_validation and ('username' not in local_var_params or # noqa: E501 - local_var_params['username'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('username') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `username` when calling `get_user_by_name`") # noqa: E501 collection_formats = {} @@ -793,12 +788,10 @@ class UserApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'username' is set - if self.api_client.client_side_validation and ('username' not in local_var_params or # noqa: E501 - local_var_params['username'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('username') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `username` when calling `login_user`") # noqa: E501 # verify the required parameter 'password' is set - if self.api_client.client_side_validation and ('password' not in local_var_params or # noqa: E501 - local_var_params['password'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('password') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `password` when calling `login_user`") # noqa: E501 collection_formats = {} @@ -806,9 +799,9 @@ class UserApi(object): path_params = {} query_params = [] - if 'username' in local_var_params and local_var_params['username'] is not None: # noqa: E501 + if local_var_params.get('username') is not None: # noqa: E501 query_params.append(('username', local_var_params['username'])) # noqa: E501 - if 'password' in local_var_params and local_var_params['password'] is not None: # noqa: E501 + if local_var_params.get('password') is not None: # noqa: E501 query_params.append(('password', local_var_params['password'])) # noqa: E501 header_params = dict(local_var_params.get('_headers', {})) @@ -1062,12 +1055,10 @@ class UserApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'username' is set - if self.api_client.client_side_validation and ('username' not in local_var_params or # noqa: E501 - local_var_params['username'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('username') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `username` when calling `update_user`") # noqa: E501 # verify the required parameter 'body' is set - if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501 - local_var_params['body'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('body') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `body` when calling `update_user`") # noqa: E501 collection_formats = {} diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/another_fake_api.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/another_fake_api.py index 4d184e6420f680383550e24de327d8b67e371936..844e1507ee94033a7768ca56544786b8bfdaa15e 100755 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/another_fake_api.py +++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/another_fake_api.py @@ -128,8 +128,7 @@ class AnotherFakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'client' is set - if self.api_client.client_side_validation and ('client' not in local_var_params or # noqa: E501 - local_var_params['client'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('client') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `client` when calling `call_123_test_special_tags`") # noqa: E501 collection_formats = {} diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_api.py index 4bb39adf2914d91225b935b923d5c51a0a17c012..b8775e2399271a29eb62a345dc9e10b9d3aeb3b0 100755 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_api.py +++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_api.py @@ -261,8 +261,7 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'pet' is set - if self.api_client.client_side_validation and ('pet' not in local_var_params or # noqa: E501 - local_var_params['pet'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('pet') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `pet` when calling `fake_http_signature_test`") # noqa: E501 collection_formats = {} @@ -270,7 +269,7 @@ class FakeApi(object): path_params = {} query_params = [] - if 'query_1' in local_var_params and local_var_params['query_1'] is not None: # noqa: E501 + if local_var_params.get('query_1') is not None: # noqa: E501 query_params.append(('query_1', local_var_params['query_1'])) # noqa: E501 header_params = dict(local_var_params.get('_headers', {})) @@ -973,8 +972,7 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'outer_object_with_enum_property' is set - if self.api_client.client_side_validation and ('outer_object_with_enum_property' not in local_var_params or # noqa: E501 - local_var_params['outer_object_with_enum_property'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('outer_object_with_enum_property') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `outer_object_with_enum_property` when calling `fake_property_enum_integer_serialize`") # noqa: E501 collection_formats = {} @@ -1255,8 +1253,7 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'file_schema_test_class' is set - if self.api_client.client_side_validation and ('file_schema_test_class' not in local_var_params or # noqa: E501 - local_var_params['file_schema_test_class'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('file_schema_test_class') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `file_schema_test_class` when calling `test_body_with_file_schema`") # noqa: E501 collection_formats = {} @@ -1398,12 +1395,10 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'query' is set - if self.api_client.client_side_validation and ('query' not in local_var_params or # noqa: E501 - local_var_params['query'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('query') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `query` when calling `test_body_with_query_params`") # noqa: E501 # verify the required parameter 'user' is set - if self.api_client.client_side_validation and ('user' not in local_var_params or # noqa: E501 - local_var_params['user'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('user') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `user` when calling `test_body_with_query_params`") # noqa: E501 collection_formats = {} @@ -1411,7 +1406,7 @@ class FakeApi(object): path_params = {} query_params = [] - if 'query' in local_var_params and local_var_params['query'] is not None: # noqa: E501 + if local_var_params.get('query') is not None: # noqa: E501 query_params.append(('query', local_var_params['query'])) # noqa: E501 header_params = dict(local_var_params.get('_headers', {})) @@ -1544,8 +1539,7 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'client' is set - if self.api_client.client_side_validation and ('client' not in local_var_params or # noqa: E501 - local_var_params['client'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('client') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `client` when calling `test_client_model`") # noqa: E501 collection_formats = {} @@ -1755,20 +1749,16 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'number' is set - if self.api_client.client_side_validation and ('number' not in local_var_params or # noqa: E501 - local_var_params['number'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('number') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `number` when calling `test_endpoint_parameters`") # noqa: E501 # verify the required parameter 'double' is set - if self.api_client.client_side_validation and ('double' not in local_var_params or # noqa: E501 - local_var_params['double'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('double') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `double` when calling `test_endpoint_parameters`") # noqa: E501 # verify the required parameter 'pattern_without_delimiter' is set - if self.api_client.client_side_validation and ('pattern_without_delimiter' not in local_var_params or # noqa: E501 - local_var_params['pattern_without_delimiter'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('pattern_without_delimiter') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`") # noqa: E501 # verify the required parameter 'byte' is set - if self.api_client.client_side_validation and ('byte' not in local_var_params or # noqa: E501 - local_var_params['byte'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('byte') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `byte` when calling `test_endpoint_parameters`") # noqa: E501 if self.api_client.client_side_validation and 'number' in local_var_params and local_var_params['number'] > 543.2: # noqa: E501 @@ -2001,14 +1991,14 @@ class FakeApi(object): path_params = {} query_params = [] - if 'enum_query_string_array' in local_var_params and local_var_params['enum_query_string_array'] is not None: # noqa: E501 + if local_var_params.get('enum_query_string_array') is not None: # noqa: E501 query_params.append(('enum_query_string_array', local_var_params['enum_query_string_array'])) # noqa: E501 collection_formats['enum_query_string_array'] = 'multi' # noqa: E501 - if 'enum_query_string' in local_var_params and local_var_params['enum_query_string'] is not None: # noqa: E501 + if local_var_params.get('enum_query_string') is not None: # noqa: E501 query_params.append(('enum_query_string', local_var_params['enum_query_string'])) # noqa: E501 - if 'enum_query_integer' in local_var_params and local_var_params['enum_query_integer'] is not None: # noqa: E501 + if local_var_params.get('enum_query_integer') is not None: # noqa: E501 query_params.append(('enum_query_integer', local_var_params['enum_query_integer'])) # noqa: E501 - if 'enum_query_double' in local_var_params and local_var_params['enum_query_double'] is not None: # noqa: E501 + if local_var_params.get('enum_query_double') is not None: # noqa: E501 query_params.append(('enum_query_double', local_var_params['enum_query_double'])) # noqa: E501 header_params = dict(local_var_params.get('_headers', {})) @@ -2174,16 +2164,13 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'required_string_group' is set - if self.api_client.client_side_validation and ('required_string_group' not in local_var_params or # noqa: E501 - local_var_params['required_string_group'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('required_string_group') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `required_string_group` when calling `test_group_parameters`") # noqa: E501 # verify the required parameter 'required_boolean_group' is set - if self.api_client.client_side_validation and ('required_boolean_group' not in local_var_params or # noqa: E501 - local_var_params['required_boolean_group'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('required_boolean_group') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `required_boolean_group` when calling `test_group_parameters`") # noqa: E501 # verify the required parameter 'required_int64_group' is set - if self.api_client.client_side_validation and ('required_int64_group' not in local_var_params or # noqa: E501 - local_var_params['required_int64_group'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('required_int64_group') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `required_int64_group` when calling `test_group_parameters`") # noqa: E501 collection_formats = {} @@ -2191,13 +2178,13 @@ class FakeApi(object): path_params = {} query_params = [] - if 'required_string_group' in local_var_params and local_var_params['required_string_group'] is not None: # noqa: E501 + if local_var_params.get('required_string_group') is not None: # noqa: E501 query_params.append(('required_string_group', local_var_params['required_string_group'])) # noqa: E501 - if 'required_int64_group' in local_var_params and local_var_params['required_int64_group'] is not None: # noqa: E501 + if local_var_params.get('required_int64_group') is not None: # noqa: E501 query_params.append(('required_int64_group', local_var_params['required_int64_group'])) # noqa: E501 - if 'string_group' in local_var_params and local_var_params['string_group'] is not None: # noqa: E501 + if local_var_params.get('string_group') is not None: # noqa: E501 query_params.append(('string_group', local_var_params['string_group'])) # noqa: E501 - if 'int64_group' in local_var_params and local_var_params['int64_group'] is not None: # noqa: E501 + if local_var_params.get('int64_group') is not None: # noqa: E501 query_params.append(('int64_group', local_var_params['int64_group'])) # noqa: E501 header_params = dict(local_var_params.get('_headers', {})) @@ -2324,8 +2311,7 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'request_body' is set - if self.api_client.client_side_validation and ('request_body' not in local_var_params or # noqa: E501 - local_var_params['request_body'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('request_body') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `request_body` when calling `test_inline_additional_properties`") # noqa: E501 collection_formats = {} @@ -2469,12 +2455,10 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'param' is set - if self.api_client.client_side_validation and ('param' not in local_var_params or # noqa: E501 - local_var_params['param'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('param') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `param` when calling `test_json_form_data`") # noqa: E501 # verify the required parameter 'param2' is set - if self.api_client.client_side_validation and ('param2' not in local_var_params or # noqa: E501 - local_var_params['param2'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('param2') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `param2` when calling `test_json_form_data`") # noqa: E501 collection_formats = {} @@ -2645,28 +2629,22 @@ class FakeApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'pipe' is set - if self.api_client.client_side_validation and ('pipe' not in local_var_params or # noqa: E501 - local_var_params['pipe'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('pipe') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `pipe` when calling `test_query_parameter_collection_format`") # noqa: E501 # verify the required parameter 'ioutil' is set - if self.api_client.client_side_validation and ('ioutil' not in local_var_params or # noqa: E501 - local_var_params['ioutil'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('ioutil') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `ioutil` when calling `test_query_parameter_collection_format`") # noqa: E501 # verify the required parameter 'http' is set - if self.api_client.client_side_validation and ('http' not in local_var_params or # noqa: E501 - local_var_params['http'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('http') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `http` when calling `test_query_parameter_collection_format`") # noqa: E501 # verify the required parameter 'url' is set - if self.api_client.client_side_validation and ('url' not in local_var_params or # noqa: E501 - local_var_params['url'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('url') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `url` when calling `test_query_parameter_collection_format`") # noqa: E501 # verify the required parameter 'context' is set - if self.api_client.client_side_validation and ('context' not in local_var_params or # noqa: E501 - local_var_params['context'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('context') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `context` when calling `test_query_parameter_collection_format`") # noqa: E501 # verify the required parameter 'allow_empty' is set - if self.api_client.client_side_validation and ('allow_empty' not in local_var_params or # noqa: E501 - local_var_params['allow_empty'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('allow_empty') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `allow_empty` when calling `test_query_parameter_collection_format`") # noqa: E501 collection_formats = {} @@ -2674,24 +2652,24 @@ class FakeApi(object): path_params = {} query_params = [] - if 'pipe' in local_var_params and local_var_params['pipe'] is not None: # noqa: E501 + if local_var_params.get('pipe') is not None: # noqa: E501 query_params.append(('pipe', local_var_params['pipe'])) # noqa: E501 collection_formats['pipe'] = 'pipes' # noqa: E501 - if 'ioutil' in local_var_params and local_var_params['ioutil'] is not None: # noqa: E501 + if local_var_params.get('ioutil') is not None: # noqa: E501 query_params.append(('ioutil', local_var_params['ioutil'])) # noqa: E501 collection_formats['ioutil'] = 'csv' # noqa: E501 - if 'http' in local_var_params and local_var_params['http'] is not None: # noqa: E501 + if local_var_params.get('http') is not None: # noqa: E501 query_params.append(('http', local_var_params['http'])) # noqa: E501 collection_formats['http'] = 'ssv' # noqa: E501 - if 'url' in local_var_params and local_var_params['url'] is not None: # noqa: E501 + if local_var_params.get('url') is not None: # noqa: E501 query_params.append(('url', local_var_params['url'])) # noqa: E501 collection_formats['url'] = 'csv' # noqa: E501 - if 'context' in local_var_params and local_var_params['context'] is not None: # noqa: E501 + if local_var_params.get('context') is not None: # noqa: E501 query_params.append(('context', local_var_params['context'])) # noqa: E501 collection_formats['context'] = 'multi' # noqa: E501 - if 'language' in local_var_params and local_var_params['language'] is not None: # noqa: E501 + if local_var_params.get('language') is not None: # noqa: E501 query_params.append(('language', local_var_params['language'])) # noqa: E501 - if 'allow_empty' in local_var_params and local_var_params['allow_empty'] is not None: # noqa: E501 + if local_var_params.get('allow_empty') is not None: # noqa: E501 query_params.append(('allowEmpty', local_var_params['allow_empty'])) # noqa: E501 header_params = dict(local_var_params.get('_headers', {})) diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_classname_tags123_api.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_classname_tags123_api.py index db8bff32161510200097b77d1227f0820089904e..4bc981fb887181df9f15b6d5d6f42463672855f1 100644 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_classname_tags123_api.py +++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/fake_classname_tags123_api.py @@ -128,8 +128,7 @@ class FakeClassnameTags123Api(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'client' is set - if self.api_client.client_side_validation and ('client' not in local_var_params or # noqa: E501 - local_var_params['client'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('client') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `client` when calling `test_classname`") # noqa: E501 collection_formats = {} diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/pet_api.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/pet_api.py index cf546a00625f60bc0dc0042d1cf3976713d8e623..ed1d8d6c504490d443b19cf5340e4715f71af425 100755 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/pet_api.py +++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/pet_api.py @@ -141,8 +141,7 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'pet' is set - if self.api_client.client_side_validation and ('pet' not in local_var_params or # noqa: E501 - local_var_params['pet'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('pet') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `pet` when calling `add_pet`") # noqa: E501 collection_formats = {} @@ -287,8 +286,7 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'pet_id' is set - if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501 - local_var_params['pet_id'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('pet_id') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `pet_id` when calling `delete_pet`") # noqa: E501 collection_formats = {} @@ -421,8 +419,7 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'status' is set - if self.api_client.client_side_validation and ('status' not in local_var_params or # noqa: E501 - local_var_params['status'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('status') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `status` when calling `find_pets_by_status`") # noqa: E501 collection_formats = {} @@ -430,7 +427,7 @@ class PetApi(object): path_params = {} query_params = [] - if 'status' in local_var_params and local_var_params['status'] is not None: # noqa: E501 + if local_var_params.get('status') is not None: # noqa: E501 query_params.append(('status', local_var_params['status'])) # noqa: E501 collection_formats['status'] = 'csv' # noqa: E501 @@ -561,8 +558,7 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'tags' is set - if self.api_client.client_side_validation and ('tags' not in local_var_params or # noqa: E501 - local_var_params['tags'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('tags') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `tags` when calling `find_pets_by_tags`") # noqa: E501 collection_formats = {} @@ -570,7 +566,7 @@ class PetApi(object): path_params = {} query_params = [] - if 'tags' in local_var_params and local_var_params['tags'] is not None: # noqa: E501 + if local_var_params.get('tags') is not None: # noqa: E501 query_params.append(('tags', local_var_params['tags'])) # noqa: E501 collection_formats['tags'] = 'csv' # noqa: E501 @@ -701,8 +697,7 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'pet_id' is set - if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501 - local_var_params['pet_id'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('pet_id') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `pet_id` when calling `get_pet_by_id`") # noqa: E501 collection_formats = {} @@ -854,8 +849,7 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'pet' is set - if self.api_client.client_side_validation and ('pet' not in local_var_params or # noqa: E501 - local_var_params['pet'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('pet') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `pet` when calling `update_pet`") # noqa: E501 collection_formats = {} @@ -1005,8 +999,7 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'pet_id' is set - if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501 - local_var_params['pet_id'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('pet_id') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `pet_id` when calling `update_pet_with_form`") # noqa: E501 collection_formats = {} @@ -1159,8 +1152,7 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'pet_id' is set - if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501 - local_var_params['pet_id'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('pet_id') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `pet_id` when calling `upload_file`") # noqa: E501 collection_formats = {} @@ -1319,12 +1311,10 @@ class PetApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'pet_id' is set - if self.api_client.client_side_validation and ('pet_id' not in local_var_params or # noqa: E501 - local_var_params['pet_id'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('pet_id') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `pet_id` when calling `upload_file_with_required_file`") # noqa: E501 # verify the required parameter 'required_file' is set - if self.api_client.client_side_validation and ('required_file' not in local_var_params or # noqa: E501 - local_var_params['required_file'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('required_file') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `required_file` when calling `upload_file_with_required_file`") # noqa: E501 collection_formats = {} diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/store_api.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/store_api.py index d66190ccbc6427565dd648885b06f6e673d1f271..02fe7dcbf57ba3f966674583e99385813a1f4513 100755 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/store_api.py +++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/store_api.py @@ -128,8 +128,7 @@ class StoreApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'order_id' is set - if self.api_client.client_side_validation and ('order_id' not in local_var_params or # noqa: E501 - local_var_params['order_id'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('order_id') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `order_id` when calling `delete_order`") # noqa: E501 collection_formats = {} @@ -387,8 +386,7 @@ class StoreApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'order_id' is set - if self.api_client.client_side_validation and ('order_id' not in local_var_params or # noqa: E501 - local_var_params['order_id'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('order_id') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `order_id` when calling `get_order_by_id`") # noqa: E501 if self.api_client.client_side_validation and 'order_id' in local_var_params and local_var_params['order_id'] > 5: # noqa: E501 @@ -531,8 +529,7 @@ class StoreApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'order' is set - if self.api_client.client_side_validation and ('order' not in local_var_params or # noqa: E501 - local_var_params['order'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('order') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `order` when calling `place_order`") # noqa: E501 collection_formats = {} diff --git a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/user_api.py b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/user_api.py index 1dc9860baf48c3114e7becc30258dc01ab66776a..4e326c6a51fd62fba2bd31bba3c3b1fa100639ee 100755 --- a/samples/openapi3/client/petstore/python-legacy/petstore_api/api/user_api.py +++ b/samples/openapi3/client/petstore/python-legacy/petstore_api/api/user_api.py @@ -128,8 +128,7 @@ class UserApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'user' is set - if self.api_client.client_side_validation and ('user' not in local_var_params or # noqa: E501 - local_var_params['user'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('user') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `user` when calling `create_user`") # noqa: E501 collection_formats = {} @@ -268,8 +267,7 @@ class UserApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'user' is set - if self.api_client.client_side_validation and ('user' not in local_var_params or # noqa: E501 - local_var_params['user'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('user') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `user` when calling `create_users_with_array_input`") # noqa: E501 collection_formats = {} @@ -408,8 +406,7 @@ class UserApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'user' is set - if self.api_client.client_side_validation and ('user' not in local_var_params or # noqa: E501 - local_var_params['user'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('user') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `user` when calling `create_users_with_list_input`") # noqa: E501 collection_formats = {} @@ -548,8 +545,7 @@ class UserApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'username' is set - if self.api_client.client_side_validation and ('username' not in local_var_params or # noqa: E501 - local_var_params['username'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('username') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `username` when calling `delete_user`") # noqa: E501 collection_formats = {} @@ -680,8 +676,7 @@ class UserApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'username' is set - if self.api_client.client_side_validation and ('username' not in local_var_params or # noqa: E501 - local_var_params['username'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('username') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `username` when calling `get_user_by_name`") # noqa: E501 collection_formats = {} @@ -825,12 +820,10 @@ class UserApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'username' is set - if self.api_client.client_side_validation and ('username' not in local_var_params or # noqa: E501 - local_var_params['username'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('username') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `username` when calling `login_user`") # noqa: E501 # verify the required parameter 'password' is set - if self.api_client.client_side_validation and ('password' not in local_var_params or # noqa: E501 - local_var_params['password'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('password') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `password` when calling `login_user`") # noqa: E501 collection_formats = {} @@ -838,9 +831,9 @@ class UserApi(object): path_params = {} query_params = [] - if 'username' in local_var_params and local_var_params['username'] is not None: # noqa: E501 + if local_var_params.get('username') is not None: # noqa: E501 query_params.append(('username', local_var_params['username'])) # noqa: E501 - if 'password' in local_var_params and local_var_params['password'] is not None: # noqa: E501 + if local_var_params.get('password') is not None: # noqa: E501 query_params.append(('password', local_var_params['password'])) # noqa: E501 header_params = dict(local_var_params.get('_headers', {})) @@ -1096,12 +1089,10 @@ class UserApi(object): local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'username' is set - if self.api_client.client_side_validation and ('username' not in local_var_params or # noqa: E501 - local_var_params['username'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('username') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `username` when calling `update_user`") # noqa: E501 # verify the required parameter 'user' is set - if self.api_client.client_side_validation and ('user' not in local_var_params or # noqa: E501 - local_var_params['user'] is None): # noqa: E501 + if self.api_client.client_side_validation and local_var_params.get('user') is None: # noqa: E501 raise ApiValueError("Missing the required parameter `user` when calling `update_user`") # noqa: E501 collection_formats = {}