mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-07 19:08:52 +00:00
update js promise petstore sample
This commit is contained in:
parent
30315c8570
commit
e83646064f
@ -314,7 +314,7 @@
|
||||
* @returns A value of the specified type.
|
||||
*/
|
||||
exports.prototype.deserialize = function deserialize(response, returnType) {
|
||||
if (response == null || returnType == null) {
|
||||
if (response == null || returnType == null || response.status == 204) {
|
||||
return null;
|
||||
}
|
||||
// Rely on SuperAgent for parsing response body.
|
||||
@ -404,8 +404,12 @@
|
||||
if (error) {
|
||||
reject(error);
|
||||
} else {
|
||||
try {
|
||||
var data = _this.deserialize(response, returnType);
|
||||
resolve(data);
|
||||
} catch (err) {
|
||||
reject(err);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user