x-amazon-apigateway-gateway-responses object - Amazon API Gateway
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

x-amazon-apigateway-gateway-responses object

Defines the gateway responses for an API as a string-to-GatewayResponse map of key-value pairs. The extension applies to the root-level OpenAPI structure.

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 OpenAPI example defines a GatewayResponses map that contains 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": "'domain.com'" }, "responseTemplates": { "application/json": "{\"message\": test 4xx b }" } }, "INVALID_API_KEY": { "statusCode": "429", "responseTemplates": { "application/json": "{\"message\": test forbidden }" } } } }