Maximum number of Request Validators for this API has been reached

Hey guys, i’m having an issue during deployment where the requestValidators limit has been reached?

Here is the full error:

Maximum number of Request Validators for this API has been reached. (Service: AmazonApiGateway; Status Code: 429; Error Code: LimitExceededException; Request ID: 0cd4c8d6-33d8-4044-b8bd-3eb7f5b5fc4c; Proxy: null).

Currently i’m using JSON Schema validator for each PUT and POST api in a format like so:

{
    "definitions": {},
    "$schema": "http://json-schema.org/draft-04/schema",
    "type": "object",
    "title": "Create Inventory Item API",
    "required": [
      "category", 
      "title"
    ],
    "properties": {
      "id": {
        "type": "string",
        "title": "The category Schema",
        "default": "computer"
      },
      "category": {
        "type": "string",
        "title": "The category Schema",
        "default": "computer",
        "pattern": "^(computer)$"
      },
      "title": {
        "type": "string",
        "title": "The title Schema",
        "default": ""
      },
      "description": {
        "type": ["string" , "null"],
        "title": "The Description Schema",
        "default": ""
      }
    }
  }

I put a support ticket in with AWS and they responded that there is a limit of 20 validators per stack and I should only need 3 or so validators and reuse them? But I can’t see how with this implementation. Would anyone be able to help? Are the JSON Schema validators turned in to request validators even?

Thanks alot!
Brian

1 Like

Hi I got the same problem. Did you find a solution ?
Thanks

1 Like

Hey Marc, any luck with this?

The schema validators don’t reuse the existing validators basically, so we need to manually specify them for each api. i’m working on it at the moment just having an issue with outputting the request validator for reuse across stacks.

I’m using https://www.serverless.com/plugins/serverless-reqvalidator-plugin to create a validator for reuse. Another thing is it seems there are already default validators in api gw provided, however i’m not sure how to use them in each lambda. A validate-body and query-and-headers and both together seems to exist.

If I get a fix in i’ll post what I did here and check how CDK handles request validation XD
I’m very surprised the validator limit isn’t mentioned in AWS documentation. Probably some feedback there.

Hi Brian,

As AWS Suggested you can have max of three validators but you can have multiple Models. Each model can hold the schema. To validate the Rest API you can refer to the Model and refer to the existing validator about what to validate.

Hi, do you have an example of the working yml code about this? Really appreciate it!