Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ValidationError

Validation error description.

Hierarchy

  • ValidationError

Index

Constructors

constructor

Properties

Optional children

children: undefined | ValidationError[]

Contains all nested validation errors of the property.

Optional constraints

constraints: undefined | {}

Constraints that failed validation with error messages.

Optional contexts

contexts: undefined | {}

property

property: string

Object's property that haven't pass validation.

Optional target

target: undefined | object

Object that was validated.

OPTIONAL - configurable via the ValidatorOptions.validationError.target option

Optional value

value: any

Value that haven't pass a validation.

OPTIONAL - configurable via the ValidatorOptions.validationError.value option

Methods

toString

  • toString(shouldDecorate?: boolean, hasParent?: boolean, parentPath?: string): string
  • Parameters

    • Optional shouldDecorate: boolean

      decorate the message with ANSI formatter escape codes for better readability

    • Optional hasParent: boolean

      true when the error is a child of an another one

    • Optional parentPath: string

      path as string to the parent of this property

    Returns string

Generated using TypeDoc