Amazon API Gateway
Developer Guide

x-amazon-apigateway-gateway-responses Object

Defines the gateway responses for an API as a string-to-GatewayResponse map of key-value pairs.


Property Name Type Description
responseType x-amazon-apigateway-gateway-responses.gatewayResponse

A GatewayResponse for the specified responseType.

x-amazon-apigateway-gateway-responses Example

The following API Gateway extension to Swagger example defines a GatewayResponses map containing two GatewayResponse instances, one for the DEFAULT_4XX type and another for the INVALID_API_KEY type.

{ "x-amazon-apigateway-gateway-responses": { "DEFAULT_4XX": { "responseParameters": { "gatewayresponse.header.Access-Control-Allow-Origin": "''" }, "responseTemplates": { "application/json": "{\"message\": test 4xx b }" } }, "INVALID_API_KEY": { "statusCode": "429", "responseTemplates": { "application/json": "{\"message\": test forbidden }" } } } }