RequestModel - AWS Serverless Application Model (original) (raw)

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

ResourcePolicyStatement

RequestParameter

Did this page help you? - Yes

Thanks for letting us know we're doing a good job!

If you've got a moment, please tell us what we did right so we can do more of it.

Did this page help you? - No

Thanks for letting us know this page needs work. We're sorry we let you down.

If you've got a moment, please tell us how we can make the documentation better.