diff --git a/src/main/resources/python/swagger.mustache b/src/main/resources/python/swagger.mustache index 11b817953e..e62f854c7b 100644 --- a/src/main/resources/python/swagger.mustache +++ b/src/main/resources/python/swagger.mustache @@ -159,7 +159,7 @@ class ApiClient: instance = objClass() for attr, attrType in instance.swaggerTypes.iteritems(): - if attr in obj: + if obj is not None and attr in obj and type(obj) in [list, dict]: value = obj[attr] if attrType in ['str', 'int', 'long', 'float', 'bool']: attrType = eval(attrType)