x-amazon-apigateway-integration.responses object
Defines the method's responses and specifies parameter mappings or payload mappings from integration responses to method responses.
Property name | Type | Description |
---|---|---|
Response status pattern |
x-amazon-apigateway-integration.response object |
Either a regular expression used to match the integration
response to the method response, or NoteThe |
x-amazon-apigateway-integration.responses
example
The following example shows a list of responses from 2xx
and
302
responses. For the 2xx
response, the method
response is mapped from the integration response's payload of the
application/json
or application/xml
MIME type. This
response uses the supplied mapping templates. For the 302
response, the
method response returns a Location
header whose value is derived from
the redirect.url
property on the integration response's payload.
"responses" : { "2\\d{2}" : { "statusCode" : "200", "responseTemplates" : { "application/json" : "#set ($root=$input.path('$')) { \"stage\": \"$root.name\", \"user-id\": \"$root.key\" }", "application/xml" : "#set ($root=$input.path('$')) <stage>$root.name</stage> " } }, "302" : { "statusCode" : "302", "responseParameters" : { "method.response.header.Location": "integration.response.body.redirect.url" } } }