Creates middleware that validates one part of the request and stores the parsed value in request state.
The schema (Zod schema by default)
Which request part to validate
Optionaloptions: ValidationMiddlewareOptions
Per-validator options. Optional, so a two-parameter implementation remains assignable; omitted means JSON-only bodies.
The validation middleware
Validates data against a schema.
The validated output type
The schema (Zod schema by default)
The value to validate
Ok with the parsed value, or Err with the issues
Data validation service.
Example
Since
0.1.0