From edebbcb802d4541c3bb68d95f2453bf30325ccd4 Mon Sep 17 00:00:00 2001 From: Marcos Prieto Date: Tue, 4 Aug 2015 11:51:25 +0200 Subject: [PATCH] Support for unicode headers, ie support for urlib3.util.make_headers --- .../src/main/resources/python/api_client.mustache | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 24b1e52ff3e..c37fe319a94 100644 --- a/modules/swagger-codegen/src/main/resources/python/api_client.mustache +++ b/modules/swagger-codegen/src/main/resources/python/api_client.mustache @@ -174,7 +174,7 @@ class ApiClient(object): Builds a JSON POST object. If obj is None, return None. - If obj is str, int, float, bool, return directly. + If obj is str, unicode, int, float, bool, return directly. If obj is datetime.datetime, datetime.date convert to string in iso8601 format. If obj is list, santize each element in the list. @@ -186,7 +186,7 @@ class ApiClient(object): """ if isinstance(obj, type(None)): return None - elif isinstance(obj, (str, int, float, bool, tuple)): + elif isinstance(obj, (str, unicode, int, float, bool, tuple)): return obj elif isinstance(obj, list): return [self.sanitize_for_serialization(sub_obj)