{"id":19293152,"url":"https://github.com/jweyrich/serverless-disable-request-validators","last_synced_at":"2025-10-19T11:46:54.873Z","repository":{"id":137209256,"uuid":"431615502","full_name":"jweyrich/serverless-disable-request-validators","owner":"jweyrich","description":"☁⚡ Serverless v2/v3 plugin to disable API Gateway request validators.","archived":false,"fork":false,"pushed_at":"2021-12-01T15:43:41.000Z","size":132,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-01T20:41:52.176Z","etag":null,"topics":["aws-apigateway","aws-lambda","microservices","request-validator","serverless","serverless-plugin"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/serverless-disable-request-validators","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jweyrich.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-24T20:11:04.000Z","updated_at":"2023-05-11T00:32:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"ed8dd5e8-233f-409f-af6a-dff0ca2e8ec6","html_url":"https://github.com/jweyrich/serverless-disable-request-validators","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jweyrich%2Fserverless-disable-request-validators","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jweyrich%2Fserverless-disable-request-validators/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jweyrich%2Fserverless-disable-request-validators/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jweyrich%2Fserverless-disable-request-validators/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jweyrich","download_url":"https://codeload.github.com/jweyrich/serverless-disable-request-validators/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250195039,"owners_count":21390230,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws-apigateway","aws-lambda","microservices","request-validator","serverless","serverless-plugin"],"created_at":"2024-11-09T22:34:10.979Z","updated_at":"2025-10-19T11:46:54.775Z","avatar_url":"https://github.com/jweyrich.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# serverless-disable-request-validators\n\n[![serverless](http://public.serverless.com/badges/v2.svg)](http://www.serverless.com) [![npm version](https://badge.fury.io/js/serverless-disable-request-validators.svg)](https://badge.fury.io/js/serverless-disable-request-validators) [![Build Status](https://travis-ci.org/jweyrich/serverless-disable-request-validators.svg?branch=master)](https://travis-ci.org/jweyrich/serverless-disable-request-validators)\n\nServerless v2 plugin to disable API Gateway request validators.\n\n## What it does\n\nIt gives you the [ability to disable or remove the API Gateway Request Validator on Serverless v2](https://github.com/serverless/serverless/issues/10229) until the Serverless Framework team introduces an opt-out flag or another mechanism to avoid the [automatic creation of Request Validators in API Gateway](https://www.serverless.com/framework/docs/providers/aws/events/apigateway/#request-schema-validators) when your Lambda functions have an schema associated with them.\n\nIf you have all request validations implemented in your Lambda, you probably don't to use the API Gateway Request Validator.\n\nThere are 3 legitimate use cases for these schemas:\n\n1. Apply basic request validation at the API Gateway level (before it reaches the Lambda);\n2. Export the API definition in another format - https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-export-api.html\n3. Generate a client SDK for some languages - https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-generate-sdk-console.html\n\nIf you want cases 2 and 3 but not case 1, this plugin can help you!\n\n## Install\n\n```sh\nyarn add --dev serverless-disable-request-validators\n# or\nnpm install -D serverless-disable-request-validators\n```\n\n## Enable the plugin\n\nAdd the following plugin to your `serverless.yml`:\n\n```yaml\nplugins:\n  - serverless-disable-request-validators\n```\n\n## Configure\n\nYou can configure the plugin behavior using the `custom` section in your `serverless.yml` file.\n\n1. Only disable the `body` and `parameters` validations directly in all validator resources (`AWS::ApiGateway::RequestValidator`):\n\n```yaml\ncustom:\n  serverless-disable-request-validators:\n    action: disable\n```\n\n2. Only disassociate all the validator resources (`AWS::ApiGateway::RequestValidator`) from API resources (`AWS::ApiGateway::Method`), effectively deleting the references to the validator resources:\n\n```yaml\ncustom:\n  serverless-disable-request-validators:\n    action: disassociate\n```\n\n3. To delete all validator (`AWS::ApiGateway::RequestValidator`) resources:\n\n```yaml\ncustom:\n  serverless-disable-request-validators:\n    action: delete\n```\n\nIf no custom configuration is provided, the default `action` is `disable`.\n\n## Caveats\n\nIf during the same deploy you try to disassociate your APIs resources from a validator and also delete the referenced validator resource, it **will fail** with the following error message:\n\n![Error message in a picture](resources/screenshot1.png)\n\nThe reason seems to be that your deployed APIs still reference the validator resources and CloudFormation doesn't handle the dependency between them correctly. The **solution** is to deploy twice, as follows:\n\n1. **Deploy 1**: _disassociate_ the validator using `action: disassociate`.\n2. **Deploy 2**: _delete_ the validator using `action: delete`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjweyrich%2Fserverless-disable-request-validators","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjweyrich%2Fserverless-disable-request-validators","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjweyrich%2Fserverless-disable-request-validators/lists"}