title: How can I set Request Validator with AWS SAM?
body: <p>I defined a model with JSONschema and set it to the lambda. I could see that the model was added in Request Body like the picture below</p>
  
  <p><a href="https://i.stack.imgur.com/vgYAo.png" rel="noreferrer"><img src="https://i.stack.imgur.com/vgYAo.png" alt="request method console picture"></a></p>
  
  <p>But I also need to set Request Validator to validate it. This is my example AWS SAM template below.</p>
  
  <pre><code>Resources:
    Api:
      Type: "AWS::Serverless::Api"
      Properties:
        StageName: !Ref Environment
        TracingEnabled: false
        EndpointConfiguration: REGIONAL
        Auth:
          Authorizers:
            Auth:
              FunctionPayloadType: TOKEN
              FunctionArn: !GetAtt Auth.Arn
              Identity:
                Header: authorization
        Models:
          RegisterCat:
            $schema: "http://json-schema.org/draft-04/hyper-schema#"
            title: RegisterCat
            type: object
            properties:
              name:
                type: string
                maxLength: 32
              species:
                type: string
                maxLength: 32
              age:
                type: integer
                minimum: 0
                maximum: 100
            required:
              - name
              - species
              - age
    RegisterCat:
      Type: "AWS::Serverless::Function"
      Properties:
        FunctionName: !Join ["-", [example, !Ref Environment, register, cat]]
        CodeUri: register_cat/
        Environment:
          Variables:
            TABLE_NAME: !Join ["-", [!Ref Environment, cat, table]]
        Policies:
          - Statement:
              - Sid: CatTable
                Effect: Allow
                Action:
                  - "dynamodb:PutItem"
                Resource: !GetAtt CatTable.Arn
        Events:
          PublicApi:
            Type: Api
            Properties:
              Path: /cat/
              Method: POST
              RestApiId: !Ref Api
              RequestModel:
                Model: RegisterCat
                Required: true
  </code></pre>
  
  <p>I can see that there is an option to add request validator when you create method in aws cli or Cloudformation</p>
  
  <pre><code>  put-method
  --rest-api-id &lt;value&gt;
  --resource-id &lt;value&gt;
  --http-method &lt;value&gt;
  --authorization-type &lt;value&gt;
  [--authorizer-id &lt;value&gt;]
  [--api-key-required | --no-api-key-required]
  [--operation-name &lt;value&gt;]
  [--request-parameters &lt;value&gt;]
  [--request-models &lt;value&gt;]
  [--request-validator-id &lt;value&gt;]
  [--authorization-scopes &lt;value&gt;]
  [--cli-input-json &lt;value&gt;]
  [--generate-cli-skeleton &lt;value&gt;]
  </code></pre>
  
  <pre><code>Type: AWS::ApiGateway::Method
  Properties: 
    ApiKeyRequired: Boolean
    AuthorizationScopes: 
      - String
    AuthorizationType: String
    AuthorizerId: String
    HttpMethod: String
    Integration: 
      Integration
    MethodResponses: 
      - MethodResponse
    OperationName: String
    RequestModels: 
      Key : Value
    RequestParameters: 
      Key : Value
    RequestValidatorId: String
    ResourceId: String
    RestApiId: String
  </code></pre>
  
  <p>I read SAM specification document in Github several times and tried setting the request validator. However I couldn't find any way to set it up with SAM. Is there a way to set the request validator on method or should I request the feature in SAM repo?</p>
  
  <p>Thank you for reading my question.</p>