helpful-ice-5738
02/20/2019, 7:27 PMconst _301_method = new aws.apigateway.MethodResponse("301Method", {
httpMethod: demo_method_get.httpMethod,
resourceId: demo_resource_with_params.id,
restApi: demo_api.id,
statusCode: "301",
responseParameters: {"method.response.header.Location": true}
});
const _301_integration = new aws.apigateway.IntegrationResponse("301Integration", {
httpMethod: demo_method_get.httpMethod,
resourceId: demo_resource_with_params.id,
restApi: demo_api.id,
statusCode: _301_method.statusCode,
responseParameters: {"method.response.header.Location": true}
}, {dependsOn: [demo_integration_get, _301_method]});
and get the response from AWS: Plan apply failed: Error creating API Gateway Integration Response: BadRequestException: Invalid mapping expression specified: Validation Result: warnings : [], errors : [Invalid mapping expression specified: 1]
lemon-spoon-91807
02/20/2019, 7:27 PM* const myDemoIntegrationResponse = new aws.apigateway.IntegrationResponse("MyDemoIntegrationResponse", {
* httpMethod: myDemoMethod.httpMethod,
* resourceId: myDemoResource.id,
* // Transforms the backend JSON response to XML
* responseTemplates: {
* "application/xml": `#set($inputRoot = $input.path('$'))
* <?xml version="1.0" encoding="UTF-8"?>
* <message>
* $inputRoot.body
* </message>
* `,
* },
* restApi: myDemoAPI.id,
* statusCode: _200.statusCode,
* });
responseParameters: {"method.response.header.Location": true}
: true
bithelpful-ice-5738
02/20/2019, 7:41 PM"method.response.header.Location": "integration.response.body.location"
and you can assert whatever value you want for .location.lemon-spoon-91807
02/21/2019, 12:01 AMhelpful-ice-5738
02/21/2019, 12:02 AM