Merge pull request #70 from sibblegp/fix_python_obj_type

Only check in lists and dictionaries
This commit is contained in:
Tony Tam 2013-10-18 08:25:10 -07:00
commit 6f1a4a2f82

View File

@ -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)