Files
nest/packages/common/interfaces/external/validation-error.interface.ts
2021-01-13 11:44:55 +01:00

43 lines
961 B
TypeScript

/**
* Validation error description.
* @see https://github.com/typestack/class-validator
*
* class-validator@0.13.0
*
* @publicApi
*/
export interface ValidationError {
/**
* Object that was validated.
*
* OPTIONAL - configurable via the ValidatorOptions.validationError.target option
*/
target?: Record<string, any>;
/**
* Object's property that hasn't passed validation.
*/
property: string;
/**
* Value that haven't pass a validation.
*
* OPTIONAL - configurable via the ValidatorOptions.validationError.value option
*/
value?: any;
/**
* Constraints that failed validation with error messages.
*/
constraints?: {
[type: string]: string;
};
/**
* Contains all nested validation errors of the property.
*/
children?: ValidationError[];
/**
* A transient set of data passed through to the validation result for response mapping
*/
contexts?: {
[type: string]: any;
};
}