Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ValidatorOptions

Options passed to validator during validation.

Hierarchy

  • ValidatorOptions

Index

Properties

Optional always

always: undefined | boolean

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

Optional dismissDefaultMessages

dismissDefaultMessages: undefined | boolean

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

Optional enableDebugMessages

enableDebugMessages: undefined | boolean

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

Optional forbidNonWhitelisted

forbidNonWhitelisted: undefined | boolean

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

Optional forbidUnknownValues

forbidUnknownValues: undefined | boolean

Settings true will cause fail validation of unknown objects.

Optional groups

groups: undefined | string[]

Groups to be used during validation of the object.

Optional skipMissingProperties

skipMissingProperties: undefined | boolean

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

Optional skipNullProperties

skipNullProperties: undefined | boolean

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

Optional skipUndefinedProperties

skipUndefinedProperties: undefined | boolean

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

Optional stopAtFirstError

stopAtFirstError: undefined | boolean

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

Optional strictGroups

strictGroups: undefined | boolean

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

Optional validationError

validationError: undefined | { target?: undefined | boolean; value?: undefined | boolean }

ValidationError special options.

Optional whitelist

whitelist: undefined | 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.

Generated using TypeDoc