Skip to main content

Official middlewares

Middy comes with a series of additional (opt-in) plugins that are officially maintained by the core team and kept in sync with every release of the core package.

These middleware focus on common use cases when using Lambda with other AWS services.

Each middleware should do a single task. We try to balance each to be as performant as possible while meeting the majority of developer needs.

Misc

Request Transformation

  • event-normalizer: Middleware for iterating through an AWS event records, parsing and normalizing nested events.
  • http-content-negotiation: Parses Accept-* headers and provides utilities for content negotiation (charset, encoding, language and media type) for HTTP requests
  • http-event-normalizer: Normalizes HTTP events by adding an empty object for queryStringParameters, multiValueQueryStringParameters or pathParameters if they are missing.
  • http-header-normalizer: Normalizes HTTP header names to their canonical format
  • http-json-body-parser: Automatically parses HTTP requests with JSON body and converts the body into an object. Also handles gracefully broken JSON if used in combination of httpErrorHandler.
  • http-multipart-body-parser: Automatically parses HTTP requests with content type multipart/form-data and converts the body into an object.
  • http-urlencode-body-parser: Automatically parses HTTP requests with URL encoded body (typically the result of a form submit).
  • http-urlencode-path-parser: Automatically parses HTTP requests with URL encoded path.
  • validator: Automatically validates incoming events and outgoing responses against custom schemas.
  • ws-json-body-parser: Automatically parses WebSocket requests with JSON message and converts the message into an object.

Response Transformation

Fetch Data