@@ -183,7 +183,7 @@ class ApiClient(object):
183
183
Builds a JSON POST object.
184
184
185
185
If obj is None, return None.
186
- If obj is str, int, float, bool, return directly.
186
+ If obj is str, int, long, float, bool, return directly.
187
187
If obj is datetime.datetime, datetime.date
188
188
convert to string in iso8601 format.
189
189
If obj is list, sanitize each element in the list.
@@ -193,7 +193,7 @@ class ApiClient(object):
193
193
:param obj: The data to serialize.
194
194
:return: The serialized form of data.
195
195
"""
196
- types = (str, int, float, bool, tuple)
196
+ types = (str, int, long, float, bool, tuple)
197
197
if sys.version_info < (3, 0):
198
198
types = types + (unicode,)
199
199
if isinstance(obj, type(None)):
@@ -269,14 +269,14 @@ class ApiClient(object):
269
269
270
270
# convert str to class
271
271
# for native types
272
- if klass in ['int', 'float', 'str', 'bool',
272
+ if klass in ['int', 'long', ' float', 'str', 'bool',
273
273
"date", 'datetime', "object"]:
274
274
klass = eval(klass)
275
275
# for model types
276
276
else:
277
277
klass = eval('models.' + klass)
278
278
279
- if klass in [int, float, str, bool]:
279
+ if klass in [int, long, float, str, bool]:
280
280
return self.__deserialize_primitive(data, klass)
281
281
elif klass == object:
282
282
return self.__deserialize_object(data)
@@ -505,7 +505,7 @@ class ApiClient(object):
505
505
:param data: str.
506
506
:param klass: class literal.
507
507
508
- :return: int, float, str, bool.
508
+ :return: int, long, float, str, bool.
509
509
"""
510
510
try:
511
511
value = klass(data)
0 commit comments