x-amazon-apigateway-gateway-響應對象 - Amazon API 网关

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

x-amazon-apigateway-gateway-響應對象

將的閘道回應定義API為索引鍵值配對的字串對GatewayResponse映。延伸套用至根層級的「開啟」(OpenAPI) 結構。

屬性名稱 類型 描述
responseType x-amazon-apigateway-gateway-回應。 gatewayResponse

A 代GatewayResponse表指定的 responseType.

x-amazon-apigateway-gateway-響應示例

下列要開啟的 API Gateway 延伸模組API範例定義了包含兩個GatewayResponse執行個體的對GatewayResponses映 — 一個用於DEFAULT_4XX類型,另一個用於類型。INVALID_API_KEY

{ "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 }" } } } }