x-amazon-apigateway-gateway-responses.responseParameters 对象 - Amazon API Gateway
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

x-amazon-apigateway-gateway-responses.responseParameters 对象

定义键/值对的字符串到字符串映射,从传入请求参数或使用文本字符串生成网关响应参数。仅支持用于 REST API 。

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

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

x-amazon-apigateway-gateway-responses.responseParameters 示例

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

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