

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

# x-amazon-apigateway-gateway-responses.responseParameters 物件
<a name="api-gateway-swagger-extensions-gateway-responses.responseParameters"></a>

定義鍵值對之字串對字串的對應，以從傳入請求參數或使用字串常值產生閘道回應參數。僅支援 REST API。


| 屬性名稱 | 類型 | 描述 | 
| --- | --- | --- | 
| gatewayresponse.param-position.param-name | string |  `param-position` 可以是 `header`、`path` 或 `querystring`。如需詳細資訊，請參閱[API Gateway 中 REST API 的參數映射](rest-api-parameter-mapping.md)。  | 

## x-amazon-apigateway-gateway-responses.responseParameters 範例
<a name="api-gateway-swagger-extensions-gateway-responses.responseParameters-example"></a>

 下列 OpenAPI 延伸範例示範 [GatewayResponse](https://docs.aws.amazon.com/apigateway/latest/api/API_GatewayResponse.html) 回應參數對應運算式，以允許 `*.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
      }
```