From 65f86dbb0f3549821c357171f44c86325bdbeb5b Mon Sep 17 00:00:00 2001 From: DariusM Date: Thu, 17 Sep 2015 10:31:40 +0200 Subject: [PATCH] unicode type forgotten in api_client.mustache for python2, works also with python3 --- .../src/main/resources/python/api_client.mustache | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/swagger-codegen/src/main/resources/python/api_client.mustache b/modules/swagger-codegen/src/main/resources/python/api_client.mustache index 8b948b5f4e8..4b10f96a73e 100644 --- a/modules/swagger-codegen/src/main/resources/python/api_client.mustache +++ b/modules/swagger-codegen/src/main/resources/python/api_client.mustache @@ -187,9 +187,12 @@ class ApiClient(object): :param obj: The data to serialize. :return: The serialized form of data. """ + types = (str, int, float, bool, tuple) + if sys.version_info < (3,0): + types = types + (unicode,) if isinstance(obj, type(None)): return None - elif isinstance(obj, (str, int, float, bool, tuple, unicode)): + elif isinstance(obj, types): return obj elif isinstance(obj, list): return [self.sanitize_for_serialization(sub_obj)