Skip to content

Commit 90b5e31

Browse files
committed
minor #12439 [Validator] Options min and max of Length constraint not required simultaneously (ohvitorino)
This PR was merged into the 3.4 branch. Discussion ---------- [Validator] Options `min` and `max` of Length constraint not required simultaneously As for the Count validator constraint (see: #12416]) the options `min` and `max` of the Length constraint are not required simultaneously. Commits ------- 0f22305 Make clear when the options min and max are required
2 parents dd0ec96 + 0f22305 commit 90b5e31

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

reference/constraints/Length.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,11 @@ min
122122

123123
**type**: ``integer``
124124

125-
This required option is the "min" length value. Validation will fail if
125+
This option is the "min" length value. Validation will fail if
126126
the given value's length is **less** than this min value.
127127

128+
This option is required when the ``max`` option is not defined.
129+
128130
It is important to notice that NULL values and empty strings are considered
129131
valid no matter if the constraint required a minimum length. Validators
130132
are triggered only if the value is not blank.
@@ -134,9 +136,11 @@ max
134136

135137
**type**: ``integer``
136138

137-
This required option is the "max" length value. Validation will fail if
139+
This option is the "max" length value. Validation will fail if
138140
the given value's length is **greater** than this max value.
139141

142+
This option is required when the ``min`` option is not defined.
143+
140144
charset
141145
~~~~~~~
142146

0 commit comments

Comments
 (0)