mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-08 19:33:55 +00:00
Merge pull request #1043 from marcospri/develop_2.0
Support for nested lists/maps for the python client
This commit is contained in:
commit
e78844cb54
@ -247,12 +247,12 @@ class ApiClient(object):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
if type(klass) == str:
|
if type(klass) == str:
|
||||||
if 'list[' in klass:
|
if klass.startswith('list['):
|
||||||
sub_kls = re.match('list\[(.*)\]', klass).group(1)
|
sub_kls = re.match('list\[(.*)\]', klass).group(1)
|
||||||
return [self.__deserialize(sub_data, sub_kls)
|
return [self.__deserialize(sub_data, sub_kls)
|
||||||
for sub_data in data]
|
for sub_data in data]
|
||||||
|
|
||||||
if 'dict(' in klass:
|
if klass.startswith('dict('):
|
||||||
sub_kls = re.match('dict\(([^,]*), (.*)\)', klass).group(2)
|
sub_kls = re.match('dict\(([^,]*), (.*)\)', klass).group(2)
|
||||||
return {k: self.__deserialize(v, sub_kls)
|
return {k: self.__deserialize(v, sub_kls)
|
||||||
for k, v in iteritems(data)}
|
for k, v in iteritems(data)}
|
||||||
|
Loading…
Reference in New Issue
Block a user