title: Are format attributes supported in API Gateway request validators?
body: <p>I've added a request validator to my API Gateway swagger file (OAS 3.0). When I test the validation by passing in an invalid request body the error message I receive includes errors that I don't understand. Steps to reproduce are below.</p>
  
  <ol>
  <li>Create a new api gateway using the following swagger:</li>
  </ol>
  
  <pre><code>openapi: 3.0.0
  info:
    version: "1"
    title: Request Validation Example
    description: |
      ## Request Validation
      Minimal swagger to reproduce request validation errors.
  
  x-amazon-apigateway-request-validators: 
    all:
      validateRequestBody: true
      validateRequestParameters: true
  x-amazon-apigateway-gateway-responses:
    BAD_REQUEST_BODY:
      statusCode: 400
      responseTemplates:
        application/json: |
          {
            message: $context.error.messageString
            errors: $context.error.validationErrorString
          }
  paths:
    /employee:
      post:
        x-amazon-apigateway-request-validator: all
        summary: Create a new Employee
        operationId: CreateEmployee
        requestBody:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Employee"
          required: true
        responses:
          "201":
            description: Created
            $ref: "#/components/responses/200"
  components:
    responses:
      "200":
        description: Success
    schemas:
      Employee:
        type: object
        properties:
          id:
            type: integer
            format: int32
          phoneNumbers:
            type: array
            items:
              $ref: "#/components/schemas/PhoneNumber"
          salary:
            type: number
            format: double
        required:
          - phoneNumbers
          - salary      
      PhoneNumber:
        type: object
        properties:
          number:
            type: string
        required:
          - number
  </code></pre>
  
  <ol start="2">
  <li><p>Set up the integration method for the newly created employee resource, choose the mock integration.</p></li>
  <li><p>Test the employee POST method using the following request body:</p></li>
  </ol>
  
  <pre><code>{
      "id": 1,
      "phoneNumbers": [
          {
              "number": "1234567890"
          }
      ],
      "salary": 45000
  }
  </code></pre>
  
  <p>Request validation will succeed with this request body</p>
  
  <ol start="4">
  <li>Test the employee POST method with the following request body:</li>
  </ol>
  
  <pre><code>{
      "id": "1",
      "phoneNumbers": [
          {
              "number": "1234567890"
          }
      ],
      "salary": 45000
  }
  </code></pre>
  
  <p>You will now see the following request validation error: </p>
  
  <pre><code>{
    message:  "Invalid request body"
    errors: [instance type (string) does not match any allowed primitive type (allowed: [\"integer\"]), format attribute \"double\" not supported, format attribute \"int32\" not supported]
  }
  </code></pre>
  
  <p>You can see that this message includes the correct error saying that the string id doesn't match the type integer. You will also see errors regarding format attributes double and int32 not being supported, these are the errors I don't understand. As far as I know double and int32 format attributes are supported by OAS 2.0 and 3.0. Do API Gateway request validators support the double and int32 format attributes? Is the request validator incorrectly configured in my swagger definition?</p>
  
  <p><strong>Edit</strong>:
  It appears that the int32 and double format attributes are known issues: <a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-known-issues.html#api-gateway-known-issues-rest-apis" rel="nofollow noreferrer">https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-known-issues.html#api-gateway-known-issues-rest-apis</a></p>
  
  <p>However, I also experience these issues using a regex in the format attribute. This isn't specifically mentioned in the known issues so still looking for information on that.</p>