diff --git a/content/techniques/validation.md b/content/techniques/validation.md index 286ef9598f..78e525a43b 100644 --- a/content/techniques/validation.md +++ b/content/techniques/validation.md @@ -30,7 +30,7 @@ Because this pipe uses the [`class-validator`](https://github.com/typestack/clas export interface ValidationPipeOptions extends ValidatorOptions { transform?: boolean; disableErrorMessages?: boolean; - exceptionFactory?: (errors: ValidationError[]) => any; + exceptionFactory?: (errors: ValidationError[] | string[]) => any; } ``` @@ -129,6 +129,16 @@ In addition to these, all `class-validator` options (inherited from the `Validat boolean When set to true, validation of the given property will stop after encountering the first error. Defaults to false. + + disableFlattenErrorMessages + boolean + When set to true, the validation errors array will maintain its original structured format as ValidationError objects, rather than being flattened into an array of strings. + + + flatExceptionFactoryMessage + boolean + When set to true and an exceptionFactory is provided, the validation errors array will be flattened into an array of strings. + > info **Notice** Find more information about the `class-validator` package in its [repository](https://github.com/typestack/class-validator).