Skip to content

Commit 07a7135

Browse files
committed
fix(apigateway): correct invalid JSON in StepFunctions 500 response template
1 parent 879afd6 commit 07a7135

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,9 @@ function integrationResponse() {
214214
selectionPattern: '5\\d{2}',
215215
statusCode: '500',
216216
responseTemplates: {
217-
'application/json': '"error": $input.path(\'$.error\')',
217+
'application/json': `{
218+
"error": "$input.path('$.error')"
219+
}`,
218220
},
219221
},
220222
];

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,9 @@ function getIntegrationResponse() {
558558
SelectionPattern: '5\\d{2}',
559559
StatusCode: '500',
560560
ResponseTemplates: {
561-
'application/json': '"error": $input.path(\'$.error\')',
561+
'application/json': `{
562+
"error": "$input.path('$.error')"
563+
}`,
562564
},
563565
},
564566
];

0 commit comments

Comments
 (0)