

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

# RequestParameter
<a name="sam-property-function-requestparameter"></a>

为特定 Api\$1路径\$1方法配置请求参数。

需要为请求参数指定 `Required` 或 `Caching` 属性

## 语法
<a name="sam-property-function-requestparameter-syntax"></a>

要在 AWS Serverless Application Model (AWS SAM) 模板中声明此实体，请使用以下语法。

### YAML
<a name="sam-property-function-requestparameter-syntax.yaml"></a>

```
  [Caching](#sam-function-requestparameter-caching): Boolean
  [Required](#sam-function-requestparameter-required): Boolean
```

## Properties
<a name="sam-property-function-requestparameter-properties"></a>

 `Caching`   <a name="sam-function-requestparameter-caching"></a>
在 API Gateway OpenApi 定义中添加`cacheKeyParameters`章节  
*类型*：布尔值  
*必需*：条件  
*CloudFormation 兼容性*：此属性是独有的 AWS SAM ，没有 CloudFormation 等效属性。

 `Required`   <a name="sam-function-requestparameter-required"></a>
此字段指定是否需要参数。  
*类型*：布尔值  
*必需*：条件  
*CloudFormation 兼容性*：此属性是独有的 AWS SAM ，没有 CloudFormation 等效属性。

## 示例
<a name="sam-property-function-requestparameter--examples"></a>

### 请求参数
<a name="sam-property-function-requestparameter--examples--request-parameter"></a>

设置请求参数的示例

#### YAML
<a name="sam-property-function-requestparameter--examples--request-parameter--yaml"></a>

```
RequestParameters:
  - method.request.header.Authorization:
      Required: true
      Caching: true
```