Interface ValidZenValidationError

interface ValidZenValidationError {
    validationArgumentsConstraints?: any[];
    children?: Partial<ValidZenValidationError>[];
    toString?(shouldDecorate?: boolean, hasParent?: boolean, parentPath?: string, showConstraintMessages?: boolean): string;
    target?: object;
    property?: string;
    value?: any;
    constraints?: {
        [type: string]: string;
    };
    contexts?: {
        [type: string]: any;
    };
}

Hierarchy

  • Omit<Partial<ValidationError>, "children">
    • ValidZenValidationError

Methods

  • Parameters

    • OptionalshouldDecorate: boolean

      decorate the message with ANSI formatter escape codes for better readability

    • OptionalhasParent: boolean

      true when the error is a child of an another one

    • OptionalparentPath: string

      path as string to the parent of this property

    • OptionalshowConstraintMessages: boolean

      show constraint messages instead of constraint names

    Returns string

Properties

validationArgumentsConstraints?: any[]
children?: Partial<ValidZenValidationError>[]
target?: object

Object that was validated.

OPTIONAL - configurable via the ValidatorOptions.validationError.target option

property?: string

Object's property that haven't pass validation.

value?: any

Value that haven't pass a validation.

OPTIONAL - configurable via the ValidatorOptions.validationError.value option

constraints?: {
    [type: string]: string;
}

Constraints that failed validation with error messages.

contexts?: {
    [type: string]: any;
}