diff --git a/src/main/resources/python/swagger.mustache b/src/main/resources/python/swagger.mustache index 20428d278e5..c635d85b90d 100644 --- a/src/main/resources/python/swagger.mustache +++ b/src/main/resources/python/swagger.mustache @@ -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 diff --git a/src/main/resources/python3/swagger.mustache b/src/main/resources/python3/swagger.mustache index 3dec8b0d215..2fcb394fe33 100644 --- a/src/main/resources/python3/swagger.mustache +++ b/src/main/resources/python3/swagger.mustache @@ -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