diff --git a/content/techniques/validation.md b/content/techniques/validation.md index a7f59fdc55..ab9d28cdab 100644 --- a/content/techniques/validation.md +++ b/content/techniques/validation.md @@ -31,6 +31,7 @@ export interface ValidationPipeOptions extends ValidatorOptions { transform?: boolean; disableErrorMessages?: boolean; exceptionFactory?: (errors: ValidationError[]) => any; + errorFormat?: 'list' | 'grouped'; } ``` @@ -129,6 +130,11 @@ 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. + + errorFormat + 'list' | 'grouped' + Specifies the format of validation error messages. 'list' (default) returns an array of error message strings. 'grouped' returns an object with property paths as keys and arrays of unmodified error messages as values, preserving custom validation messages without prepending parent path prefixes. + > info **Notice** Find more information about the `class-validator` package in its [repository](https://github.com/typestack/class-validator).