RequestModel
Configures a Request Model for a specific Api+Path+Method.
Syntax
To declare this entity in your AWS Serverless Application Model (AWS 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
AWS CloudFormation compatibility: This property is unique to AWS SAM and doesn't have an AWS CloudFormation equivalent.
-
Required
-
Adds a
required
property in the parameters section of the OpenApi definition for the given API endpoint.Type: Boolean
Required: No
AWS CloudFormation compatibility: This property is unique to AWS SAM and doesn't have an AWS 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
AWS CloudFormation compatibility: This property is unique to AWS SAM and doesn't have an AWS 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
AWS CloudFormation compatibility: This property is unique to AWS SAM and doesn't have an AWS CloudFormation equivalent.
Examples
Request Model
Request Model Example
YAML
RequestModel: Model: User Required: true ValidateBody: true ValidateParameters: true