Setu-TS
    Preparing search index...

    Type Alias ValidatorMiddleware<T>

    ValidatorMiddleware: MiddlewareFunction & { value(ctx: IRequestContext): T }

    Validation middleware with a reader bound to this middleware instance. The reader returns the parsed value only after this instance validates the request successfully and before another validator overwrites that target.

    Type Parameters

    • T

      The parsed value produced by this validator

    Type Declaration

    const body = validateBody(Schema);
    router.post('/items', {
    middleware: [body],
    handler: (ctx) => ctx.response.json(body.value(ctx)),
    });

    0.10.0