Menu
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.

Properties

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.

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