From befacc41bdfc58dc61323523b0afcb20912fd7df Mon Sep 17 00:00:00 2001 From: Marcos Prieto Date: Tue, 4 Aug 2015 11:51:38 +0200 Subject: [PATCH] Support for nested dict/list Checking for `startwith` instead of just `in` to correctly categorize nested structures. --- .../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 c37fe319a94..6152fd9a68c 100644 --- a/modules/swagger-codegen/src/main/resources/python/api_client.mustache +++ b/modules/swagger-codegen/src/main/resources/python/api_client.mustache @@ -247,12 +247,12 @@ class ApiClient(object): return None if type(klass) == str: - if 'list[' in klass: + if klass.startswith('list['): sub_kls = re.match('list\[(.*)\]', klass).group(1) return [self.__deserialize(sub_data, sub_kls) for sub_data in data] - if 'dict(' in klass: + if klass.startswith('dict('): sub_kls = re.match('dict\(([^,]*), (.*)\)', klass).group(2) return {k: self.__deserialize(v, sub_kls) for k, v in iteritems(data)}