JSPM

serverless-plugin-ts-validation

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q26421F
  • License MIT

Validate lambdas from your Typescript sources

Package Exports

  • serverless-plugin-ts-validation

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (serverless-plugin-ts-validation) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

serverless-plugin-ts-validation

serverless

This is a serverless plugin made to enable automatic validation of your AWS lambda functions from typescript interfaces.

This plugin should be compatible with other plugins such as the serverless-plugin-typescript.

Under the hood it uses the ts-json-schema-generator library to generate a json schema from an interface, and sends it to AWS proxy as an input validator.

The validation enables AWS proxy to validate the input, without needing the lambda functions to be called (saving you some money 💰) and ensuring the inputs to your functions are valid.

Notes:

  • This currently works for simple cases, but since the json schema we create is version 7.0, and AWS only supports version 4.0, there might be cases where AWS rejects the schema generated.
  • The schema files are not currently stored locally, this could be a potential future feature.
  • There are no provided default tsconfig.json, you will need to provide your own in the root directory.

This plugin would not have been possible without:

  • ts-json-schema-generator
  • serverless-plugin-typescript

PRs welcomed! 🙂