forked from loafle/openapi-generator-original
update js samples
This commit is contained in:
@@ -463,6 +463,25 @@
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Constructs a new map or array model from REST data.
|
||||
* @param data {Object|Array} The REST data.
|
||||
* @param obj {Object|Array} The target object or array.
|
||||
*/
|
||||
exports.constructFromObject = function(data, obj, itemType) {
|
||||
if (Array.isArray(data)) {
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
if (data.hasOwnProperty(i))
|
||||
obj[i] = exports.convertToType(data[i], itemType);
|
||||
}
|
||||
} else {
|
||||
for (var k in data) {
|
||||
if (data.hasOwnProperty(k))
|
||||
result[k] = exports.convertToType(data[k], itemType);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* The default API client implementation.
|
||||
* @type {module:ApiClient}
|
||||
|
||||
Reference in New Issue
Block a user