Overview
Middleware executes before endpoint handlers, providing authentication, context, and input validation. Middleware can be chained and composed.Configuration
input
Type:ZodObject
Input validation schema for the middleware.
handler
Type:Handler<Input, Output, Context>
Required: Yes
Async function that returns context for endpoints.
security
Type:SecuritySchema
Security requirements for OpenAPI documentation.