Skip to content

Commit d87c904

Browse files
committed
feat(common): add new option disableFlattenErrorMessages to validation pipe
1 parent 32203b0 commit d87c904

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

content/techniques/validation.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Because this pipe uses the [`class-validator`](https://github.com/typestack/clas
3030
export interface ValidationPipeOptions extends ValidatorOptions {
3131
transform?: boolean;
3232
disableErrorMessages?: boolean;
33-
exceptionFactory?: (errors: ValidationError[]) => any;
33+
exceptionFactory?: (errors: ValidationError[] | string[]) => any;
3434
}
3535
```
3636

@@ -129,6 +129,11 @@ In addition to these, all `class-validator` options (inherited from the `Validat
129129
<td><code>boolean</code></td>
130130
<td>When set to true, validation of the given property will stop after encountering the first error. Defaults to false.</td>
131131
</tr>
132+
<tr>
133+
<td><code>disableFlattenErrorMessages</code></td>
134+
<td><code>boolean</code></td>
135+
<td>When set to true, the validation errors array will maintain its original structured format as <code>ValidationError</code> objects, rather than being flattened into an array of strings.</td>
136+
</tr>
132137
</table>
133138

134139
> info **Notice** Find more information about the `class-validator` package in its [repository](https://github.com/typestack/class-validator).

0 commit comments

Comments
 (0)