UNPKG

1.03 kBTypeScriptView Raw
1/**
2 * Validation error description.
3 * @see https://github.com/typestack/class-validator
4 *
5 * class-validator@0.13.0
6 *
7 * @publicApi
8 */
9export interface ValidationError {
10 /**
11 * Object that was validated.
12 *
13 * OPTIONAL - configurable via the ValidatorOptions.validationError.target option
14 */
15 target?: Record<string, any>;
16 /**
17 * Object's property that hasn't passed validation.
18 */
19 property: string;
20 /**
21 * Value that haven't pass a validation.
22 *
23 * OPTIONAL - configurable via the ValidatorOptions.validationError.value option
24 */
25 value?: any;
26 /**
27 * Constraints that failed validation with error messages.
28 */
29 constraints?: {
30 [type: string]: string;
31 };
32 /**
33 * Contains all nested validation errors of the property.
34 */
35 children?: ValidationError[];
36 /**
37 * A transient set of data passed through to the validation result for response mapping
38 */
39 contexts?: {
40 [type: string]: any;
41 };
42}