Skip to content

Commit

Permalink
feat(common): add new option disableFlattenErrorMessages to validatio…
Browse files Browse the repository at this point in the history
…n pipe
  • Loading branch information
civilcoder55 committed Jan 3, 2025
1 parent 32203b0 commit d87c904
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion content/techniques/validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
```

Expand Down Expand Up @@ -129,6 +129,11 @@ In addition to these, all `class-validator` options (inherited from the `Validat
<td><code>boolean</code></td>
<td>When set to true, validation of the given property will stop after encountering the first error. Defaults to false.</td>
</tr>
<tr>
<td><code>disableFlattenErrorMessages</code></td>
<td><code>boolean</code></td>
<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>
</tr>
</table>

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

0 comments on commit d87c904

Please sign in to comment.