Skip to content

Commit 4639067

Browse files
docs(validation): add more class validator options
1 parent b369245 commit 4639067

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

content/techniques/validation.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,21 @@ In addition to these, all `class-validator` options (inherited from the `Validat
4242
<th>Type</th>
4343
<th>Description</th>
4444
</tr>
45+
<tr>
46+
<td><code>enableDebugMessages</code></td>
47+
<td><code>boolean</code></td>
48+
<td>If set to true, validator will print extra warning messages to the console when something is not right.</td>
49+
</tr>
50+
<tr>
51+
<td><code>skipUndefinedProperties</code></td>
52+
<td><code>boolean</code></td>
53+
<td>If set to true, validator will skip validation of all properties that are null in the validating object.</td>
54+
</tr>
55+
<tr>
56+
<td><code>skipNullProperties</code></td>
57+
<td><code>boolean</code></td>
58+
<td> If set to true, validator will skip validation of all properties that are null or undefined in the validating object.</td>
59+
</tr>
4560
<tr>
4661
<td><code>skipMissingProperties</code></td>
4762
<td><code>boolean</code></td>
@@ -82,6 +97,17 @@ In addition to these, all `class-validator` options (inherited from the `Validat
8297
<td><code>string[]</code></td>
8398
<td>Groups to be used during validation of the object.</td>
8499
</tr>
100+
<tr>
101+
<td><code>always</code></td>
102+
<td><code>boolean</code></td>
103+
<td>Set default for <code>always</code> option of decorators. Default can be overridden in decorator options</td>
104+
</tr>
105+
106+
<tr>
107+
<td><code>strictGroups</code></td>
108+
<td><code>boolean</code></td>
109+
<td>If <code>groups</code> is not given or is empty, ignore decorators with at least one group.</td>
110+
</tr>
85111
<tr>
86112
<td><code>dismissDefaultMessages</code></td>
87113
<td><code>boolean</code></td>
@@ -98,11 +124,15 @@ In addition to these, all `class-validator` options (inherited from the `Validat
98124
<td><code>boolean</code></td>
99125
<td>Indicates if validated value should be exposed in <code>ValidationError</code>.</td>
100126
</tr>
127+
<tr>
128+
<td><code>stopAtFirstError</code></td>
129+
<td><code>boolean</code></td>
130+
<td>When set to true, validation of the given property will stop after encountering the first error. Defaults to false.</td>
131+
</tr>
101132
</table>
102133

103134
> info **Notice** Find more information about the `class-validator` package in its [repository](https://github.com/typestack/class-validator).
104135
105-
106136
#### Auto-validation
107137

108138
We'll start by binding `ValidationPipe` at the application level, thus ensuring all endpoints are protected from receiving incorrect data.

0 commit comments

Comments
 (0)