Skip to content

Commit 6f1a4a2

Browse files
committed
Merge pull request #70 from sibblegp/fix_python_obj_type
Only check in lists and dictionaries
2 parents a96d49f + 0628c63 commit 6f1a4a2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/resources/python/swagger.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ class ApiClient:
159159
instance = objClass()
160160

161161
for attr, attrType in instance.swaggerTypes.iteritems():
162-
if attr in obj:
162+
if obj is not None and attr in obj and type(obj) in [list, dict]:
163163
value = obj[attr]
164164
if attrType in ['str', 'int', 'long', 'float', 'bool']:
165165
attrType = eval(attrType)

0 commit comments

Comments
 (0)