forked from loafle/openapi-generator-original
Handle arbitrary object in JS client
Closes #2165 Other changes: * Update JS client of the Petstore sample * Add test cases for getPetByIdInObject and getInventoryInObject
This commit is contained in:
@@ -306,7 +306,10 @@
|
||||
case 'Date':
|
||||
return this.parseDate(String(data));
|
||||
default:
|
||||
if (typeof type === 'function') {
|
||||
if (type === Object) {
|
||||
// generic object, return directly
|
||||
return data;
|
||||
} else if (typeof type === 'function') {
|
||||
// for model type like: User
|
||||
var model = type.constructFromObject(data);
|
||||
return model;
|
||||
|
||||
Reference in New Issue
Block a user