AWS API Gateway Model Validation CLI tool
  • TypeScript 95.7%
  • JavaScript 3.9%
  • Batchfile 0.4%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-09-26 14:06:07 +01:00
.github/workflows Add GitHub Action to validate OpenSpec in CI 2026-09-26 13:58:05 +01:00
bin Initial commit 2021-08-12 21:10:09 +01:00
examples Cleaning up 2021-08-27 22:14:40 +01:00
openspec Add OpenSpec configuration and initial CLI validation specification 2026-09-26 13:57:06 +01:00
schema Cleaning up 2021-08-27 22:14:40 +01:00
src Update logic to allow for programatic use 2021-09-01 22:50:15 +01:00
test Updated to allow for path/method lookups too 2021-08-21 11:44:21 +01:00
.editorconfig Initial commit 2021-08-12 21:10:09 +01:00
.eslintignore Initial commit 2021-08-12 21:10:09 +01:00
.eslintrc Initial commit 2021-08-12 21:10:09 +01:00
.gitignore Add OpenSpec configuration and initial CLI validation specification 2026-09-26 13:57:06 +01:00
.travis.yml Added travis ci 2021-09-11 17:59:22 +01:00
package-lock.json Update logic to allow for programatic use 2021-09-01 22:50:15 +01:00
package.json Update logic to allow for programatic use 2021-09-01 22:50:15 +01:00
README.md Update logic to allow for programatic use 2021-09-01 22:50:15 +01:00
tsconfig.json Cleaned up build 2021-08-27 13:12:45 +01:00

apigw-model-validator

A simple tool for validation request payloads against AWS Api Definitions

oclif Version Downloads/week License

Usage

$ npm install -g apigw-model-validator
$ apigw-model-validator COMMAND
running command...
$ apigw-model-validator (-v|--version|version)
apigw-model-validator/1.0.0 darwin-x64 node-v12.18.3
$ apigw-model-validator --help [COMMAND]
USAGE
  $ apigw-model-validator COMMAND
...
const AMV = require('apigw-model-validator')
const validator = new AMV()

validator.isPayloadValid({
  model: 'UserDetails',
  payload: {
    username: 'Joe Bloggs'
  },
  schema: './user.yml'
})
  .then(() => {
    console.log('Payload is valid)
  })
  .catch(err => {
    console.error('Payload is invalid, err)
  })

validator.isPayloadValid({
  path: '/app/use-details',
  payload: {
    username: 'Joe Bloggs'
  },
  requestMethod: 'POST',
  schema: './user.yml'
})
  .then(() => {
    console.log('Payload is valid)
  })
  .catch(err => {
    console.error('Payload is invalid, err)
  })