Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/deno_class_validator/src/index.ts>ValidatorOptions

Decorator-based property validation for classes.
Latest
interface ValidatorOptions
Re-export
import { type ValidatorOptions } from "https://deno.land/x/deno_class_validator@v1.0.0/src/index.ts";

Options passed to validator during validation.

Properties

optional
enableDebugMessages: boolean

If set to true then class-validator will print extra warning messages to the console when something is not right.

optional
skipUndefinedProperties: boolean

If set to true then validator will skip validation of all properties that are undefined in the validating object.

optional
skipNullProperties: boolean

If set to true then validator will skip validation of all properties that are null in the validating object.

optional
skipMissingProperties: boolean

If set to true then validator will skip validation of all properties that are null or undefined in the validating object.

optional
whitelist: boolean

If set to true validator will strip validated object of any properties that do not have any decorators.

Tip: if no other decorator is suitable for your property use @Allow decorator.

optional
forbidNonWhitelisted: boolean

If set to true, instead of stripping non-whitelisted properties validator will throw an error

optional
groups: string[]

Groups to be used during validation of the object.

optional
always: boolean

Set default for always option of decorators. Default can be overridden in decorator options.

optional
strictGroups: boolean

If [groups]ValidatorOptions#groups is not given or is empty, ignore decorators with at least one group.

optional
dismissDefaultMessages: boolean

If set to true, the validation will not use default messages. Error message always will be undefined if its not explicitly set.

optional
validationError: { target?: boolean; value?: boolean; }

ValidationError special options.

optional
forbidUnknownValues: boolean

Settings true will cause fail validation of unknown objects.

optional
stopAtFirstError: boolean

When set to true, validation of the given property will stop after encountering the first error. Defaults to false.