forked from loafle/openapi-generator-original
Only check in lists and dictionaries
The "in" operator also works on strings which can cause problems with this line if the attribute and the object are named the same thing. Signed-off-by: George Sibble <gsibble@gmail.com>
This commit is contained in:
parent
3cbf2abc5c
commit
4d05b5d81f
@ -159,7 +159,7 @@ class ApiClient:
|
||||
instance = objClass()
|
||||
|
||||
for attr, attrType in instance.swaggerTypes.iteritems():
|
||||
if attr in obj:
|
||||
if attr in obj and type(obj) in [list, dict]:
|
||||
value = obj[attr]
|
||||
if attrType in ['str', 'int', 'long', 'float', 'bool']:
|
||||
attrType = eval(attrType)
|
||||
|
Loading…
x
Reference in New Issue
Block a user