Setu-TS
    Preparing search index...

    Interface ValidationPluginOptions

    Options for ValidationPlugin.

    0.1.0

    interface ValidationPluginOptions {
        errorFormat?: ValidationErrorFormatter | ErrorFormat;
        forbidNonWhitelisted?: boolean;
        whitelist?: boolean;
    }
    Index

    Error response format. Defaults to 'default'.

    Pass 'default', 'rfc9457', or 'nestjs' for built-in formatters, or provide a custom ValidationErrorFormatter function.

    forbidNonWhitelisted?: boolean

    When true, reject payloads carrying properties the schema does not declare.

    Applied once per middleware at registration time by calling the schema's own .strict() (Zod-style), and takes precedence over ValidationPluginOptions.whitelist when both are set (rejecting is stronger than stripping). A schema that does not expose .strict() is used unchanged.

    whitelist?: boolean

    When true, strip properties the schema does not declare.

    Applied once per middleware at registration time by calling the schema's own .strip() (Zod-style). A schema that does not expose .strip() — a non-object schema, or a validator other than Zod — is used unchanged, since schemas are duck-typed through safeParse.