bunway
    Preparing search index...

    Interface ValidationOptions

    interface ValidationOptions {
        abortEarly?: boolean;
        errorFormatter?: (errors: ValidationError[]) => unknown;
        onError?: (
            errors: ValidationError[],
            req: BunRequest,
            res: BunResponse,
            next: NextFunction,
        ) => void;
        statusCode?: number;
    }
    Index

    Properties

    abortEarly?: boolean

    If true, abort on first error. If false, collect all errors. Default: false (collect all)

    errorFormatter?: (errors: ValidationError[]) => unknown

    Custom error formatter. Receives the array of errors and returns the response body. Default: returns { errors: [...] }

    onError?: (
        errors: ValidationError[],
        req: BunRequest,
        res: BunResponse,
        next: NextFunction,
    ) => void

    Custom error handler. If provided, called instead of sending automatic response. Allows full control over error handling (e.g., pass to next(err)).

    statusCode?: number

    HTTP status code for validation errors. Default: 422.