Skip to content

Commit 6c350a7

Browse files
author
Maneesh Sahu-SSI
committed
Added long to primitive data types supported in Python codegen
1 parent 8943585 commit 6c350a7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

modules/swagger-codegen/src/main/resources/python/api_client.mustache

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ class ApiClient(object):
180180
Builds a JSON POST object.
181181

182182
If obj is None, return None.
183-
If obj is str, int, float, bool, return directly.
183+
If obj is str, int, long, float, bool, return directly.
184184
If obj is datetime.datetime, datetime.date
185185
convert to string in iso8601 format.
186186
If obj is list, sanitize each element in the list.
@@ -190,7 +190,7 @@ class ApiClient(object):
190190
:param obj: The data to serialize.
191191
:return: The serialized form of data.
192192
"""
193-
types = (str, int, float, bool, tuple)
193+
types = (str, int, long, float, bool, tuple)
194194
if sys.version_info < (3, 0):
195195
types = types + (unicode,)
196196
if isinstance(obj, type(None)):
@@ -266,14 +266,14 @@ class ApiClient(object):
266266

267267
# convert str to class
268268
# for native types
269-
if klass in ['int', 'float', 'str', 'bool',
269+
if klass in ['int', 'long', 'float', 'str', 'bool',
270270
"date", 'datetime', "object"]:
271271
klass = eval(klass)
272272
# for model types
273273
else:
274274
klass = eval('models.' + klass)
275275

276-
if klass in [int, float, str, bool]:
276+
if klass in [int, long, float, str, bool]:
277277
return self.__deserialize_primitive(data, klass)
278278
elif klass == object:
279279
return self.__deserialize_object(data)
@@ -501,7 +501,7 @@ class ApiClient(object):
501501
:param data: str.
502502
:param klass: class literal.
503503

504-
:return: int, float, str, bool.
504+
:return: int, long, float, str, bool.
505505
"""
506506
try:
507507
value = klass(data)

0 commit comments

Comments
 (0)