x-amazon-apigateway-gateway-responses.responseparameter - Amazon API Gateway

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

x-amazon-apigateway-gateway-responses.responseparameter

定义键值对 string-to-string 映射,以根据传入的请求参数或使用文字字符串生成网关响应参数。仅支持用于 REST API 。

属性
属性名称 类型 说明
gatewayresponse.param-position.param-name string

param-position 可以是 headerpathquerystring。有关更多信息,请参阅将方法请求数据映射至集成请求参数

x-amazon-apigateway-gateway-responses.responseparameter

以下 OpenAPI 扩展示例显示了一个GatewayResponse响应参数映射表达式,用于为域上的资源启用 CORS 支持。*.example.domain

"responseParameters": { "gatewayresponse.header.Access-Control-Allow-Origin": '*.example.domain', "gatewayresponse.header.from-request-header" : method.request.header.Accept, "gatewayresponse.header.from-request-path" : method.request.path.petId, "gatewayresponse.header.from-request-query" : method.request.querystring.qname }