Skip to content

Commit

Permalink
Merge pull request #759 from jormaechea/Issue-758-Bugfix
Browse files Browse the repository at this point in the history
Fixed undefined and null responseParameter values
  • Loading branch information
dnalborczyk committed Jul 27, 2019
2 parents 89ce799 + 736b6bc commit 30d3a61
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/ApiGateway.js
Expand Up @@ -656,10 +656,18 @@ module.exports = class ApiGateway {
if (value.startsWith('integration.response')) {
if (valueArray[2] === 'body') {
debugLog('Found body in right-hand');
headerValue = (valueArray[3]
? jsonPath(result, valueArray.slice(3).join('.'))
: result
).toString();
headerValue = (valueArray[3]
? jsonPath(result, valueArray.slice(3).join('.'))
: result
);
if(typeof headerValue === 'undefined' || headerValue === null) {
debugLog(
`Warning: empty value for responseParameter "${key}": "${value}"`,
);
headerValue = '';
} else {
headerValue = headerValue.toString();
}
} else {
this.printBlankLine();
this.log(
Expand Down

0 comments on commit 30d3a61

Please sign in to comment.