AWS Lambda Middleware is a lightweight library (v1.1.2, last updated 2023) for applying middleware and validating request parameters in AWS Lambda functions. It provides PropTypes for type checking and data correction, a Validate function for custom rules, and supports Express and other frameworks. Key differentiators include minimal overhead for Lambda, deep array/object validation, and customizable error message templates. Release cadence is sporadic, with major changes between v0.9 and v1.0 including reserved prop names, option changes, and required() method replacing isRequired.
npm install aws-lambda-middlewareNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a Lambda handler with parameter validation using PropTypes and middleware chaining.
Update code: use .required() instead of .isRequired, change Prop.*.default(({event}) => {}) to named parameters, use .option({trim: false}) for per-prop trim.Remove required() from object/array props if they should be optional; or add .default() to avoid required validation.
Replace .isRequired with .required() method.
Upgrade to v1.0.4 or later.
Upgrade to v1.0.4 or later.
Change to Prop.string.required()
Rename the prop to something else (e.g., 'params').
Use named parameter object: Prop.string.default(({event}) => event.headers['x-id'])No dependency data recorded yet.