From e115e52ed549dc6518f3a6ff1710c11a62e45a06 Mon Sep 17 00:00:00 2001 From: Colossal Code <54778962+colossal-code@users.noreply.github.com> Date: Tue, 29 Oct 2019 20:54:45 +0530 Subject: [PATCH 1/7] [Python] Remove redundant else condition --- .../main/resources/python/api_client.mustache | 23 +++++++++---------- .../python-asyncio/petstore_api/api_client.py | 23 +++++++++---------- .../python-tornado/petstore_api/api_client.py | 23 +++++++++---------- .../python/petstore_api/api_client.py | 23 +++++++++---------- .../python/petstore_api/api_client.py | 23 +++++++++---------- 5 files changed, 55 insertions(+), 60 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/api_client.mustache b/modules/openapi-generator/src/main/resources/python/api_client.mustache index 4c0be2fe868a..7ff01459a005 100644 --- a/modules/openapi-generator/src/main/resources/python/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/api_client.mustache @@ -347,18 +347,17 @@ class ApiClient(object): response_type, auth_settings, _return_http_data_only, collection_formats, _preload_content, _request_timeout, _host) - else: - thread = self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, query_params, - header_params, body, - post_params, files, - response_type, auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host)) - return thread + + return self.pool.apply_async(self.__call_api, (resource_path, + method, path_params, query_params, + header_params, body, + post_params, files, + response_type, auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, + _request_timeout, + _host)) def request(self, method, url, query_params=None, headers=None, post_params=None, body=None, _preload_content=True, diff --git a/samples/client/petstore/python-asyncio/petstore_api/api_client.py b/samples/client/petstore/python-asyncio/petstore_api/api_client.py index 8aab3aefb45d..430e7f2ced4b 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/api_client.py +++ b/samples/client/petstore/python-asyncio/petstore_api/api_client.py @@ -340,18 +340,17 @@ def call_api(self, resource_path, method, response_type, auth_settings, _return_http_data_only, collection_formats, _preload_content, _request_timeout, _host) - else: - thread = self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, query_params, - header_params, body, - post_params, files, - response_type, auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host)) - return thread + + return self.pool.apply_async(self.__call_api, (resource_path, + method, path_params, query_params, + header_params, body, + post_params, files, + response_type, auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, + _request_timeout, + _host)) def request(self, method, url, query_params=None, headers=None, post_params=None, body=None, _preload_content=True, diff --git a/samples/client/petstore/python-tornado/petstore_api/api_client.py b/samples/client/petstore/python-tornado/petstore_api/api_client.py index c3c8c6103e43..475590e8da87 100644 --- a/samples/client/petstore/python-tornado/petstore_api/api_client.py +++ b/samples/client/petstore/python-tornado/petstore_api/api_client.py @@ -342,18 +342,17 @@ def call_api(self, resource_path, method, response_type, auth_settings, _return_http_data_only, collection_formats, _preload_content, _request_timeout, _host) - else: - thread = self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, query_params, - header_params, body, - post_params, files, - response_type, auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host)) - return thread + + return self.pool.apply_async(self.__call_api, (resource_path, + method, path_params, query_params, + header_params, body, + post_params, files, + response_type, auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, + _request_timeout, + _host)) def request(self, method, url, query_params=None, headers=None, post_params=None, body=None, _preload_content=True, diff --git a/samples/client/petstore/python/petstore_api/api_client.py b/samples/client/petstore/python/petstore_api/api_client.py index 57e2758ecac7..8bdeea458a65 100644 --- a/samples/client/petstore/python/petstore_api/api_client.py +++ b/samples/client/petstore/python/petstore_api/api_client.py @@ -340,18 +340,17 @@ def call_api(self, resource_path, method, response_type, auth_settings, _return_http_data_only, collection_formats, _preload_content, _request_timeout, _host) - else: - thread = self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, query_params, - header_params, body, - post_params, files, - response_type, auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host)) - return thread + + return self.pool.apply_async(self.__call_api, (resource_path, + method, path_params, query_params, + header_params, body, + post_params, files, + response_type, auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, + _request_timeout, + _host)) def request(self, method, url, query_params=None, headers=None, post_params=None, body=None, _preload_content=True, diff --git a/samples/openapi3/client/petstore/python/petstore_api/api_client.py b/samples/openapi3/client/petstore/python/petstore_api/api_client.py index 57e2758ecac7..8bdeea458a65 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api_client.py @@ -340,18 +340,17 @@ def call_api(self, resource_path, method, response_type, auth_settings, _return_http_data_only, collection_formats, _preload_content, _request_timeout, _host) - else: - thread = self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, query_params, - header_params, body, - post_params, files, - response_type, auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host)) - return thread + + return self.pool.apply_async(self.__call_api, (resource_path, + method, path_params, query_params, + header_params, body, + post_params, files, + response_type, auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, + _request_timeout, + _host)) def request(self, method, url, query_params=None, headers=None, post_params=None, body=None, _preload_content=True, From d8ce7d75ec418b6fc14129e420436b5de4cf8e7e Mon Sep 17 00:00:00 2001 From: Colossal Code <54778962+colossal-code@users.noreply.github.com> Date: Tue, 29 Oct 2019 21:44:43 +0530 Subject: [PATCH 2/7] Add indentation --- .../main/resources/python/api_client.mustache | 18 +++++++++--------- .../python-asyncio/petstore_api/api_client.py | 18 +++++++++--------- .../python-tornado/petstore_api/api_client.py | 18 +++++++++--------- .../petstore/python/petstore_api/api_client.py | 18 +++++++++--------- .../petstore/python/petstore_api/api_client.py | 18 +++++++++--------- 5 files changed, 45 insertions(+), 45 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/api_client.mustache b/modules/openapi-generator/src/main/resources/python/api_client.mustache index 7ff01459a005..e1705dbe7f61 100644 --- a/modules/openapi-generator/src/main/resources/python/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/api_client.mustache @@ -349,15 +349,15 @@ class ApiClient(object): _preload_content, _request_timeout, _host) return self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, query_params, - header_params, body, - post_params, files, - response_type, auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host)) + method, path_params, query_params, + header_params, body, + post_params, files, + response_type, auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, + _request_timeout, + _host)) def request(self, method, url, query_params=None, headers=None, post_params=None, body=None, _preload_content=True, diff --git a/samples/client/petstore/python-asyncio/petstore_api/api_client.py b/samples/client/petstore/python-asyncio/petstore_api/api_client.py index 430e7f2ced4b..5fd255e3933e 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/api_client.py +++ b/samples/client/petstore/python-asyncio/petstore_api/api_client.py @@ -342,15 +342,15 @@ def call_api(self, resource_path, method, _preload_content, _request_timeout, _host) return self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, query_params, - header_params, body, - post_params, files, - response_type, auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host)) + method, path_params, query_params, + header_params, body, + post_params, files, + response_type, auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, + _request_timeout, + _host)) def request(self, method, url, query_params=None, headers=None, post_params=None, body=None, _preload_content=True, diff --git a/samples/client/petstore/python-tornado/petstore_api/api_client.py b/samples/client/petstore/python-tornado/petstore_api/api_client.py index 475590e8da87..3e440cceb92c 100644 --- a/samples/client/petstore/python-tornado/petstore_api/api_client.py +++ b/samples/client/petstore/python-tornado/petstore_api/api_client.py @@ -344,15 +344,15 @@ def call_api(self, resource_path, method, _preload_content, _request_timeout, _host) return self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, query_params, - header_params, body, - post_params, files, - response_type, auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host)) + method, path_params, query_params, + header_params, body, + post_params, files, + response_type, auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, + _request_timeout, + _host)) def request(self, method, url, query_params=None, headers=None, post_params=None, body=None, _preload_content=True, diff --git a/samples/client/petstore/python/petstore_api/api_client.py b/samples/client/petstore/python/petstore_api/api_client.py index 8bdeea458a65..e4ae16f89384 100644 --- a/samples/client/petstore/python/petstore_api/api_client.py +++ b/samples/client/petstore/python/petstore_api/api_client.py @@ -342,15 +342,15 @@ def call_api(self, resource_path, method, _preload_content, _request_timeout, _host) return self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, query_params, - header_params, body, - post_params, files, - response_type, auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host)) + method, path_params, query_params, + header_params, body, + post_params, files, + response_type, auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, + _request_timeout, + _host)) def request(self, method, url, query_params=None, headers=None, post_params=None, body=None, _preload_content=True, diff --git a/samples/openapi3/client/petstore/python/petstore_api/api_client.py b/samples/openapi3/client/petstore/python/petstore_api/api_client.py index 8bdeea458a65..e4ae16f89384 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api_client.py @@ -342,15 +342,15 @@ def call_api(self, resource_path, method, _preload_content, _request_timeout, _host) return self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, query_params, - header_params, body, - post_params, files, - response_type, auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host)) + method, path_params, query_params, + header_params, body, + post_params, files, + response_type, auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, + _request_timeout, + _host)) def request(self, method, url, query_params=None, headers=None, post_params=None, body=None, _preload_content=True, From 1f7ceb70be8c661877fd62910a9b79cb3684c543 Mon Sep 17 00:00:00 2001 From: Colossal Code <54778962+colossal-code@users.noreply.github.com> Date: Tue, 29 Oct 2019 22:08:25 +0530 Subject: [PATCH 3/7] Reduce extra indent --- .../main/resources/python/api_client.mustache | 18 +++++++++--------- .../python-asyncio/petstore_api/api_client.py | 18 +++++++++--------- .../python-tornado/petstore_api/api_client.py | 18 +++++++++--------- .../petstore/python/petstore_api/api_client.py | 18 +++++++++--------- .../petstore/python/petstore_api/api_client.py | 18 +++++++++--------- 5 files changed, 45 insertions(+), 45 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/api_client.mustache b/modules/openapi-generator/src/main/resources/python/api_client.mustache index e1705dbe7f61..f45383e9c4d7 100644 --- a/modules/openapi-generator/src/main/resources/python/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/api_client.mustache @@ -349,15 +349,15 @@ class ApiClient(object): _preload_content, _request_timeout, _host) return self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, query_params, - header_params, body, - post_params, files, - response_type, auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host)) + method, path_params, query_params, + header_params, body, + post_params, files, + response_type, auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, + _request_timeout, + _host)) def request(self, method, url, query_params=None, headers=None, post_params=None, body=None, _preload_content=True, diff --git a/samples/client/petstore/python-asyncio/petstore_api/api_client.py b/samples/client/petstore/python-asyncio/petstore_api/api_client.py index 5fd255e3933e..04dde28b6220 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/api_client.py +++ b/samples/client/petstore/python-asyncio/petstore_api/api_client.py @@ -342,15 +342,15 @@ def call_api(self, resource_path, method, _preload_content, _request_timeout, _host) return self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, query_params, - header_params, body, - post_params, files, - response_type, auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host)) + method, path_params, query_params, + header_params, body, + post_params, files, + response_type, auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, + _request_timeout, + _host)) def request(self, method, url, query_params=None, headers=None, post_params=None, body=None, _preload_content=True, diff --git a/samples/client/petstore/python-tornado/petstore_api/api_client.py b/samples/client/petstore/python-tornado/petstore_api/api_client.py index 3e440cceb92c..c8fa145cf985 100644 --- a/samples/client/petstore/python-tornado/petstore_api/api_client.py +++ b/samples/client/petstore/python-tornado/petstore_api/api_client.py @@ -344,15 +344,15 @@ def call_api(self, resource_path, method, _preload_content, _request_timeout, _host) return self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, query_params, - header_params, body, - post_params, files, - response_type, auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host)) + method, path_params, query_params, + header_params, body, + post_params, files, + response_type, auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, + _request_timeout, + _host)) def request(self, method, url, query_params=None, headers=None, post_params=None, body=None, _preload_content=True, diff --git a/samples/client/petstore/python/petstore_api/api_client.py b/samples/client/petstore/python/petstore_api/api_client.py index e4ae16f89384..83fe13b2c624 100644 --- a/samples/client/petstore/python/petstore_api/api_client.py +++ b/samples/client/petstore/python/petstore_api/api_client.py @@ -342,15 +342,15 @@ def call_api(self, resource_path, method, _preload_content, _request_timeout, _host) return self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, query_params, - header_params, body, - post_params, files, - response_type, auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host)) + method, path_params, query_params, + header_params, body, + post_params, files, + response_type, auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, + _request_timeout, + _host)) def request(self, method, url, query_params=None, headers=None, post_params=None, body=None, _preload_content=True, diff --git a/samples/openapi3/client/petstore/python/petstore_api/api_client.py b/samples/openapi3/client/petstore/python/petstore_api/api_client.py index e4ae16f89384..83fe13b2c624 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api_client.py @@ -342,15 +342,15 @@ def call_api(self, resource_path, method, _preload_content, _request_timeout, _host) return self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, query_params, - header_params, body, - post_params, files, - response_type, auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host)) + method, path_params, query_params, + header_params, body, + post_params, files, + response_type, auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, + _request_timeout, + _host)) def request(self, method, url, query_params=None, headers=None, post_params=None, body=None, _preload_content=True, From 7de0758ed98a7d31e727ac28f565b5d5a0df672c Mon Sep 17 00:00:00 2001 From: Colossal Code <54778962+colossal-code@users.noreply.github.com> Date: Tue, 29 Oct 2019 22:34:27 +0530 Subject: [PATCH 4/7] Avoid longer than 79 chars --- .../src/main/resources/python/api_client.mustache | 6 ++++-- .../petstore/python-asyncio/petstore_api/api_client.py | 6 ++++-- .../petstore/python-tornado/petstore_api/api_client.py | 6 ++++-- samples/client/petstore/python/petstore_api/api_client.py | 6 ++++-- .../client/petstore/python/petstore_api/api_client.py | 6 ++++-- 5 files changed, 20 insertions(+), 10 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/api_client.mustache b/modules/openapi-generator/src/main/resources/python/api_client.mustache index f45383e9c4d7..a7d7c3cd2159 100644 --- a/modules/openapi-generator/src/main/resources/python/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/api_client.mustache @@ -349,10 +349,12 @@ class ApiClient(object): _preload_content, _request_timeout, _host) return self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, query_params, + method, path_params, + query_params, header_params, body, post_params, files, - response_type, auth_settings, + response_type, + auth_settings, _return_http_data_only, collection_formats, _preload_content, diff --git a/samples/client/petstore/python-asyncio/petstore_api/api_client.py b/samples/client/petstore/python-asyncio/petstore_api/api_client.py index 04dde28b6220..6d45a4546652 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/api_client.py +++ b/samples/client/petstore/python-asyncio/petstore_api/api_client.py @@ -342,10 +342,12 @@ def call_api(self, resource_path, method, _preload_content, _request_timeout, _host) return self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, query_params, + method, path_params, + query_params, header_params, body, post_params, files, - response_type, auth_settings, + response_type, + auth_settings, _return_http_data_only, collection_formats, _preload_content, diff --git a/samples/client/petstore/python-tornado/petstore_api/api_client.py b/samples/client/petstore/python-tornado/petstore_api/api_client.py index c8fa145cf985..9a26a20b40c1 100644 --- a/samples/client/petstore/python-tornado/petstore_api/api_client.py +++ b/samples/client/petstore/python-tornado/petstore_api/api_client.py @@ -344,10 +344,12 @@ def call_api(self, resource_path, method, _preload_content, _request_timeout, _host) return self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, query_params, + method, path_params, + query_params, header_params, body, post_params, files, - response_type, auth_settings, + response_type, + auth_settings, _return_http_data_only, collection_formats, _preload_content, diff --git a/samples/client/petstore/python/petstore_api/api_client.py b/samples/client/petstore/python/petstore_api/api_client.py index 83fe13b2c624..ac953c4b9e05 100644 --- a/samples/client/petstore/python/petstore_api/api_client.py +++ b/samples/client/petstore/python/petstore_api/api_client.py @@ -342,10 +342,12 @@ def call_api(self, resource_path, method, _preload_content, _request_timeout, _host) return self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, query_params, + method, path_params, + query_params, header_params, body, post_params, files, - response_type, auth_settings, + response_type, + auth_settings, _return_http_data_only, collection_formats, _preload_content, diff --git a/samples/openapi3/client/petstore/python/petstore_api/api_client.py b/samples/openapi3/client/petstore/python/petstore_api/api_client.py index 83fe13b2c624..ac953c4b9e05 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api_client.py @@ -342,10 +342,12 @@ def call_api(self, resource_path, method, _preload_content, _request_timeout, _host) return self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, query_params, + method, path_params, + query_params, header_params, body, post_params, files, - response_type, auth_settings, + response_type, + auth_settings, _return_http_data_only, collection_formats, _preload_content, From a51e16208b7e979346586bae6f523953740e8cdc Mon Sep 17 00:00:00 2001 From: Colossal Code <54778962+colossal-code@users.noreply.github.com> Date: Tue, 29 Oct 2019 22:56:42 +0530 Subject: [PATCH 5/7] Remove trailing space after response_body --- .../src/main/resources/python/api_client.mustache | 2 +- .../client/petstore/python-asyncio/petstore_api/api_client.py | 2 +- .../client/petstore/python-tornado/petstore_api/api_client.py | 2 +- samples/client/petstore/python/petstore_api/api_client.py | 2 +- .../openapi3/client/petstore/python/petstore_api/api_client.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/api_client.mustache b/modules/openapi-generator/src/main/resources/python/api_client.mustache index a7d7c3cd2159..8cba076583d3 100644 --- a/modules/openapi-generator/src/main/resources/python/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/api_client.mustache @@ -353,7 +353,7 @@ class ApiClient(object): query_params, header_params, body, post_params, files, - response_type, + response_type, auth_settings, _return_http_data_only, collection_formats, diff --git a/samples/client/petstore/python-asyncio/petstore_api/api_client.py b/samples/client/petstore/python-asyncio/petstore_api/api_client.py index 6d45a4546652..a7ce4f1c6e07 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/api_client.py +++ b/samples/client/petstore/python-asyncio/petstore_api/api_client.py @@ -346,7 +346,7 @@ def call_api(self, resource_path, method, query_params, header_params, body, post_params, files, - response_type, + response_type, auth_settings, _return_http_data_only, collection_formats, diff --git a/samples/client/petstore/python-tornado/petstore_api/api_client.py b/samples/client/petstore/python-tornado/petstore_api/api_client.py index 9a26a20b40c1..8e626e0851f4 100644 --- a/samples/client/petstore/python-tornado/petstore_api/api_client.py +++ b/samples/client/petstore/python-tornado/petstore_api/api_client.py @@ -348,7 +348,7 @@ def call_api(self, resource_path, method, query_params, header_params, body, post_params, files, - response_type, + response_type, auth_settings, _return_http_data_only, collection_formats, diff --git a/samples/client/petstore/python/petstore_api/api_client.py b/samples/client/petstore/python/petstore_api/api_client.py index ac953c4b9e05..66a3800593ac 100644 --- a/samples/client/petstore/python/petstore_api/api_client.py +++ b/samples/client/petstore/python/petstore_api/api_client.py @@ -346,7 +346,7 @@ def call_api(self, resource_path, method, query_params, header_params, body, post_params, files, - response_type, + response_type, auth_settings, _return_http_data_only, collection_formats, diff --git a/samples/openapi3/client/petstore/python/petstore_api/api_client.py b/samples/openapi3/client/petstore/python/petstore_api/api_client.py index ac953c4b9e05..66a3800593ac 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api_client.py @@ -346,7 +346,7 @@ def call_api(self, resource_path, method, query_params, header_params, body, post_params, files, - response_type, + response_type, auth_settings, _return_http_data_only, collection_formats, From bc69aaae7fa7739d0d48421e47a1a446f130c225 Mon Sep 17 00:00:00 2001 From: Colossal Code <54778962+colossal-code@users.noreply.github.com> Date: Wed, 30 Oct 2019 08:35:20 +0530 Subject: [PATCH 6/7] [Python] Fix pep8 violation in imports --- .../src/main/resources/python/api_client.mustache | 3 +-- .../client/petstore/python-asyncio/petstore_api/api_client.py | 3 +-- .../client/petstore/python-tornado/petstore_api/api_client.py | 3 +-- samples/client/petstore/python/petstore_api/api_client.py | 3 +-- .../openapi3/client/petstore/python/petstore_api/api_client.py | 3 +-- 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/api_client.mustache b/modules/openapi-generator/src/main/resources/python/api_client.mustache index 8cba076583d3..790ec2204613 100644 --- a/modules/openapi-generator/src/main/resources/python/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/api_client.mustache @@ -3,6 +3,7 @@ from __future__ import absolute_import import datetime +from dateutil.parser import parse import json import mimetypes from multiprocessing.pool import ThreadPool @@ -585,7 +586,6 @@ class ApiClient(object): :return: date. """ try: - from dateutil.parser import parse return parse(string).date() except ImportError: return string @@ -604,7 +604,6 @@ class ApiClient(object): :return: datetime. """ try: - from dateutil.parser import parse return parse(string) except ImportError: return string diff --git a/samples/client/petstore/python-asyncio/petstore_api/api_client.py b/samples/client/petstore/python-asyncio/petstore_api/api_client.py index a7ce4f1c6e07..9ad41e84f6d1 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/api_client.py +++ b/samples/client/petstore/python-asyncio/petstore_api/api_client.py @@ -11,6 +11,7 @@ from __future__ import absolute_import import datetime +from dateutil.parser import parse import json import mimetypes from multiprocessing.pool import ThreadPool @@ -578,7 +579,6 @@ def __deserialize_date(self, string): :return: date. """ try: - from dateutil.parser import parse return parse(string).date() except ImportError: return string @@ -597,7 +597,6 @@ def __deserialize_datetime(self, string): :return: datetime. """ try: - from dateutil.parser import parse return parse(string) except ImportError: return string diff --git a/samples/client/petstore/python-tornado/petstore_api/api_client.py b/samples/client/petstore/python-tornado/petstore_api/api_client.py index 8e626e0851f4..bd360c4b05f2 100644 --- a/samples/client/petstore/python-tornado/petstore_api/api_client.py +++ b/samples/client/petstore/python-tornado/petstore_api/api_client.py @@ -11,6 +11,7 @@ from __future__ import absolute_import import datetime +from dateutil.parser import parse import json import mimetypes from multiprocessing.pool import ThreadPool @@ -580,7 +581,6 @@ def __deserialize_date(self, string): :return: date. """ try: - from dateutil.parser import parse return parse(string).date() except ImportError: return string @@ -599,7 +599,6 @@ def __deserialize_datetime(self, string): :return: datetime. """ try: - from dateutil.parser import parse return parse(string) except ImportError: return string diff --git a/samples/client/petstore/python/petstore_api/api_client.py b/samples/client/petstore/python/petstore_api/api_client.py index 66a3800593ac..5e7a95a35f3b 100644 --- a/samples/client/petstore/python/petstore_api/api_client.py +++ b/samples/client/petstore/python/petstore_api/api_client.py @@ -11,6 +11,7 @@ from __future__ import absolute_import import datetime +from dateutil.parser import parse import json import mimetypes from multiprocessing.pool import ThreadPool @@ -578,7 +579,6 @@ def __deserialize_date(self, string): :return: date. """ try: - from dateutil.parser import parse return parse(string).date() except ImportError: return string @@ -597,7 +597,6 @@ def __deserialize_datetime(self, string): :return: datetime. """ try: - from dateutil.parser import parse return parse(string) except ImportError: return string diff --git a/samples/openapi3/client/petstore/python/petstore_api/api_client.py b/samples/openapi3/client/petstore/python/petstore_api/api_client.py index 66a3800593ac..5e7a95a35f3b 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api_client.py @@ -11,6 +11,7 @@ from __future__ import absolute_import import datetime +from dateutil.parser import parse import json import mimetypes from multiprocessing.pool import ThreadPool @@ -578,7 +579,6 @@ def __deserialize_date(self, string): :return: date. """ try: - from dateutil.parser import parse return parse(string).date() except ImportError: return string @@ -597,7 +597,6 @@ def __deserialize_datetime(self, string): :return: datetime. """ try: - from dateutil.parser import parse return parse(string) except ImportError: return string From bb8708124472b32fae5f5927e54e9c2833814fed Mon Sep 17 00:00:00 2001 From: Colossal Code <54778962+colossal-code@users.noreply.github.com> Date: Wed, 30 Oct 2019 08:36:05 +0530 Subject: [PATCH 7/7] Revert "[Python] Fix pep8 violation in imports" This reverts commit bc69aaae7fa7739d0d48421e47a1a446f130c225. --- .../src/main/resources/python/api_client.mustache | 3 ++- .../client/petstore/python-asyncio/petstore_api/api_client.py | 3 ++- .../client/petstore/python-tornado/petstore_api/api_client.py | 3 ++- samples/client/petstore/python/petstore_api/api_client.py | 3 ++- .../openapi3/client/petstore/python/petstore_api/api_client.py | 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/api_client.mustache b/modules/openapi-generator/src/main/resources/python/api_client.mustache index 790ec2204613..8cba076583d3 100644 --- a/modules/openapi-generator/src/main/resources/python/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/api_client.mustache @@ -3,7 +3,6 @@ from __future__ import absolute_import import datetime -from dateutil.parser import parse import json import mimetypes from multiprocessing.pool import ThreadPool @@ -586,6 +585,7 @@ class ApiClient(object): :return: date. """ try: + from dateutil.parser import parse return parse(string).date() except ImportError: return string @@ -604,6 +604,7 @@ class ApiClient(object): :return: datetime. """ try: + from dateutil.parser import parse return parse(string) except ImportError: return string diff --git a/samples/client/petstore/python-asyncio/petstore_api/api_client.py b/samples/client/petstore/python-asyncio/petstore_api/api_client.py index 9ad41e84f6d1..a7ce4f1c6e07 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/api_client.py +++ b/samples/client/petstore/python-asyncio/petstore_api/api_client.py @@ -11,7 +11,6 @@ from __future__ import absolute_import import datetime -from dateutil.parser import parse import json import mimetypes from multiprocessing.pool import ThreadPool @@ -579,6 +578,7 @@ def __deserialize_date(self, string): :return: date. """ try: + from dateutil.parser import parse return parse(string).date() except ImportError: return string @@ -597,6 +597,7 @@ def __deserialize_datetime(self, string): :return: datetime. """ try: + from dateutil.parser import parse return parse(string) except ImportError: return string diff --git a/samples/client/petstore/python-tornado/petstore_api/api_client.py b/samples/client/petstore/python-tornado/petstore_api/api_client.py index bd360c4b05f2..8e626e0851f4 100644 --- a/samples/client/petstore/python-tornado/petstore_api/api_client.py +++ b/samples/client/petstore/python-tornado/petstore_api/api_client.py @@ -11,7 +11,6 @@ from __future__ import absolute_import import datetime -from dateutil.parser import parse import json import mimetypes from multiprocessing.pool import ThreadPool @@ -581,6 +580,7 @@ def __deserialize_date(self, string): :return: date. """ try: + from dateutil.parser import parse return parse(string).date() except ImportError: return string @@ -599,6 +599,7 @@ def __deserialize_datetime(self, string): :return: datetime. """ try: + from dateutil.parser import parse return parse(string) except ImportError: return string diff --git a/samples/client/petstore/python/petstore_api/api_client.py b/samples/client/petstore/python/petstore_api/api_client.py index 5e7a95a35f3b..66a3800593ac 100644 --- a/samples/client/petstore/python/petstore_api/api_client.py +++ b/samples/client/petstore/python/petstore_api/api_client.py @@ -11,7 +11,6 @@ from __future__ import absolute_import import datetime -from dateutil.parser import parse import json import mimetypes from multiprocessing.pool import ThreadPool @@ -579,6 +578,7 @@ def __deserialize_date(self, string): :return: date. """ try: + from dateutil.parser import parse return parse(string).date() except ImportError: return string @@ -597,6 +597,7 @@ def __deserialize_datetime(self, string): :return: datetime. """ try: + from dateutil.parser import parse return parse(string) except ImportError: return string diff --git a/samples/openapi3/client/petstore/python/petstore_api/api_client.py b/samples/openapi3/client/petstore/python/petstore_api/api_client.py index 5e7a95a35f3b..66a3800593ac 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api_client.py @@ -11,7 +11,6 @@ from __future__ import absolute_import import datetime -from dateutil.parser import parse import json import mimetypes from multiprocessing.pool import ThreadPool @@ -579,6 +578,7 @@ def __deserialize_date(self, string): :return: date. """ try: + from dateutil.parser import parse return parse(string).date() except ImportError: return string @@ -597,6 +597,7 @@ def __deserialize_datetime(self, string): :return: datetime. """ try: + from dateutil.parser import parse return parse(string) except ImportError: return string