RequestModel - Amazon Serverless Application Model
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

RequestModel

Configures a Request Model for a specific Api+Path+Method.

Syntax

To declare this entity in your Amazon Serverless Application Model (Amazon SAM) template, use the following syntax.

YAML

Model: String Required: Boolean ValidateBody: Boolean ValidateParameters: Boolean

Properties

Model

Name of a model defined in the Models property of the AWS::Serverless::Api.

Type: String

Required: Yes

Amazon CloudFormation compatibility: This property is unique to Amazon SAM and doesn't have an Amazon CloudFormation equivalent.

Required

Adds a required property in the parameters section of the OpenApi definition for the given API endpoint.

Type: Boolean

Required: No

Amazon CloudFormation compatibility: This property is unique to Amazon SAM and doesn't have an Amazon CloudFormation equivalent.

ValidateBody

Specifies whether API Gateway uses the Model to validate the request body. For more information, see Enable request validation in API Gateway in the API Gateway Developer Guide.

Type: Boolean

Required: No

Amazon CloudFormation compatibility: This property is unique to Amazon SAM and doesn't have an Amazon CloudFormation equivalent.

ValidateParameters

Specifies whether API Gateway uses the Model to validate request path parameters, query strings, and headers. For more information, see Enable request validation in API Gateway in the API Gateway Developer Guide.

Type: Boolean

Required: No

Amazon CloudFormation compatibility: This property is unique to Amazon SAM and doesn't have an Amazon CloudFormation equivalent.

Examples

Request Model

Request Model Example

YAML

RequestModel: Model: User Required: true ValidateBody: true ValidateParameters: true