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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user