forked from loafle/openapi-generator-original
Fix Object Type Detection to Not Incorrectly Convert Booleans and 0 Integers to None
Prior to this patch, zero integers and False booleans were being converted to None since both evaluate the origin if statement (it not obj) to True. Signed-off-by: George Sibble <gsibble@gmail.com>
This commit is contained in:
parent
a9e0635d31
commit
d7e93cbda9
@ -98,7 +98,7 @@ class ApiClient:
|
||||
def sanitizeForSerialization(self, obj):
|
||||
"""Dump an object into JSON for POSTing."""
|
||||
|
||||
if not obj:
|
||||
if type(obj) == type(None):
|
||||
return None
|
||||
elif type(obj) in [str, int, long, float, bool]:
|
||||
return obj
|
||||
|
@ -102,7 +102,7 @@ class ApiClient:
|
||||
def sanitizeForSerialization(self, obj):
|
||||
"""Dump an object into JSON for POSTing."""
|
||||
|
||||
if not obj:
|
||||
if type(obj) == type(None):
|
||||
return None
|
||||
elif type(obj) in [str, int, float, bool]:
|
||||
return obj
|
||||
|
Loading…
x
Reference in New Issue
Block a user