createValidationMiddleware(schema: unknown,target: ValidationTarget,service: IValidationService,formatter: ValidationErrorFormatter): MiddlewareFunction
Create a validation middleware function.
The middleware extracts data from the specified request target, validates it
via the provided validation service, and either stores the validated value
in ctx.state and continues the pipeline, or short-circuits with a 400
response containing the formatted validation errors.
formatter: ValidationErrorFormatter
Error formatter (resolved once at registration time)