From cc9882e586a898552c3a178b916e2593503a8b4f Mon Sep 17 00:00:00 2001 From: Jay-Chou <42150440+at7211@users.noreply.github.com> Date: Mon, 9 Feb 2026 23:02:01 +0800 Subject: [PATCH] docs: add errorFormat option to ValidationPipe documentation Document the new `errorFormat` option for ValidationPipe that allows users to choose between 'list' (default) and 'grouped' error formats. Related to nestjs/nest#16268 --- content/techniques/validation.md | 6 ++++++ 1 file changed, 6 insertions(+) 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
booleanerrorFormat'list' | 'grouped''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.