Skip to content

Commit

Permalink
list[] is now List[] in python generator
Browse files Browse the repository at this point in the history
  • Loading branch information
jablan committed Oct 13, 2023
1 parent 726d7e2 commit 7f6fd67
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions openapi-generator/templates/python/api_client.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -294,13 +294,13 @@ class ApiClient(object):
return None

if type(klass) == str:
if klass.startswith('list['):
sub_kls = re.match(r'list\[(.*)\]', klass).group(1)
if klass.startswith('List['):
sub_kls = re.match(r'List\[(.*)\]', klass).group(1)
return [self.__deserialize(sub_data, sub_kls)
for sub_data in data]

if klass.startswith('dict('):
sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2)
if klass.startswith('Dict('):
sub_kls = re.match(r'Dict\(([^,]*), (.*)\)', klass).group(2)
return {k: self.__deserialize(v, sub_kls)
for k, v in six.iteritems(data)}

Expand Down

0 comments on commit 7f6fd67

Please sign in to comment.