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 7e5ad40785be..2bfbb16c5755 100644 --- a/modules/openapi-generator/src/main/resources/python/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/api_client.mustache @@ -240,7 +240,9 @@ class ApiClient: # deserialize response data - if response_type == "bytearray" or response_type is None: + if response_type == "bytearray": + return_data = response_data.data + elif response_type is None return_data = None elif response_type == "file": return_data = self.__deserialize_file(response_data) diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/api_client.py b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/api_client.py index 52b2d87aec3f..8a4a54addc74 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/api_client.py +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true/openapi_client/api_client.py @@ -227,7 +227,9 @@ def __call_api( # deserialize response data - if response_type == "bytearray" or response_type is None: + if response_type == "bytearray": + return_data = response_data.data + elif response_type is None return_data = None elif response_type == "file": return_data = self.__deserialize_file(response_data) diff --git a/samples/client/echo_api/python/openapi_client/api_client.py b/samples/client/echo_api/python/openapi_client/api_client.py index 52b2d87aec3f..8a4a54addc74 100644 --- a/samples/client/echo_api/python/openapi_client/api_client.py +++ b/samples/client/echo_api/python/openapi_client/api_client.py @@ -227,7 +227,9 @@ def __call_api( # deserialize response data - if response_type == "bytearray" or response_type is None: + if response_type == "bytearray": + return_data = response_data.data + elif response_type is None return_data = None elif response_type == "file": return_data = self.__deserialize_file(response_data) diff --git a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api_client.py b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api_client.py index 9a56e2c9ab26..908674f09d78 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python-aiohttp/petstore_api/api_client.py @@ -207,7 +207,9 @@ async def __call_api( # deserialize response data - if response_type == "bytearray" or response_type is None: + if response_type == "bytearray": + return_data = response_data.data + elif response_type is None return_data = None elif response_type == "file": return_data = self.__deserialize_file(response_data) 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 186f11996faf..671e910940e1 100755 --- a/samples/openapi3/client/petstore/python/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api_client.py @@ -226,7 +226,9 @@ def __call_api( # deserialize response data - if response_type == "bytearray" or response_type is None: + if response_type == "bytearray": + return_data = response_data.data + elif response_type is None return_data = None elif response_type == "file": return_data = self.__deserialize_file(response_data)