Skip to content

Commit b1fce4f

Browse files
authored
fix(aws-apigateway): missing comma to make failure response payload valid json (#19253)
The failure response from a StepFunctionsRestApi integration is not valid JSON, it is missing a comma. This fixes the issue by adding a comma. Fixes #19252 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 37edda4 commit b1fce4f

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

packages/@aws-cdk/aws-apigateway/lib/integrations/stepfunctions.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ function integrationResponse() {
203203
'#if($input.path(\'$.status\').toString().equals("FAILED"))',
204204
'#set($context.responseOverride.status = 500)',
205205
'{',
206-
'"error": "$input.path(\'$.error\')"',
206+
'"error": "$input.path(\'$.error\')",',
207207
'"cause": "$input.path(\'$.cause\')"',
208208
'}',
209209
'#else',

packages/@aws-cdk/aws-apigateway/test/integ.stepfunctions-api.expected.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@
160160
"IntegrationResponses": [
161161
{
162162
"ResponseTemplates": {
163-
"application/json": "#set($inputRoot = $input.path('$'))\n#if($input.path('$.status').toString().equals(\"FAILED\"))\n#set($context.responseOverride.status = 500)\n{\n\"error\": \"$input.path('$.error')\"\n\"cause\": \"$input.path('$.cause')\"\n}\n#else\n$input.path('$.output')\n#end"
163+
"application/json": "#set($inputRoot = $input.path('$'))\n#if($input.path('$.status').toString().equals(\"FAILED\"))\n#set($context.responseOverride.status = 500)\n{\n\"error\": \"$input.path('$.error')\",\n\"cause\": \"$input.path('$.cause')\"\n}\n#else\n$input.path('$.output')\n#end"
164164
},
165165
"StatusCode": "200"
166166
},

packages/@aws-cdk/aws-apigateway/test/integrations/stepfunctions.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ function getIntegrationResponse() {
418418
'#if($input.path(\'$.status\').toString().equals("FAILED"))',
419419
'#set($context.responseOverride.status = 500)',
420420
'{',
421-
'"error": "$input.path(\'$.error\')"',
421+
'"error": "$input.path(\'$.error\')",',
422422
'"cause": "$input.path(\'$.cause\')"',
423423
'}',
424424
'#else',

packages/@aws-cdk/aws-apigateway/test/stepfunctions-api.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ function getIntegrationResponse() {
181181
'#if($input.path(\'$.status\').toString().equals("FAILED"))',
182182
'#set($context.responseOverride.status = 500)',
183183
'{',
184-
'"error": "$input.path(\'$.error\')"',
184+
'"error": "$input.path(\'$.error\')",',
185185
'"cause": "$input.path(\'$.cause\')"',
186186
'}',
187187
'#else',

0 commit comments

Comments
 (0)