Skip to content

Commit bdef484

Browse files
committed
Merge branch '2.8' into 3.4
* 2.8: Added documentation for message parameters
2 parents 8ac9a45 + cd64c71 commit bdef484

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+585
-1
lines changed

reference/constraints/Bic.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,14 @@ message
9292

9393
The default message supplied when the value does not pass the BIC check.
9494

95+
You can use the following parameters in this message:
96+
97+
+------------------+------------------------------------------------+
98+
| Parameter | Description |
99+
+==================+================================================+
100+
| ``{{ value }}`` | The current (invalid) BIC value |
101+
+------------------+------------------------------------------------+
102+
95103
.. include:: /reference/constraints/_payload-option.rst.inc
96104

97105
.. _`Business Identifier Code (BIC)`: https://en.wikipedia.org/wiki/Business_Identifier_Code

reference/constraints/Blank.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,12 @@ message
9696

9797
This is the message that will be shown if the value is not blank.
9898

99+
You can use the following parameters in this message:
100+
101+
+------------------+------------------------------------------------+
102+
| Parameter | Description |
103+
+==================+================================================+
104+
| ``{{ value }}`` | The current (invalid) value |
105+
+------------------+------------------------------------------------+
106+
99107
.. include:: /reference/constraints/_payload-option.rst.inc

reference/constraints/CardScheme.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,14 @@ message
131131

132132
The message shown when the value does not pass the ``CardScheme`` check.
133133

134+
You can use the following parameters in this message:
135+
136+
+------------------+------------------------------------------------+
137+
| Parameter | Description |
138+
+==================+================================================+
139+
| ``{{ value }}`` | The current (invalid) value |
140+
+------------------+------------------------------------------------+
141+
134142
.. include:: /reference/constraints/_payload-option.rst.inc
135143

136144
.. _`Wikipedia: Issuer identification number (IIN)`: https://en.wikipedia.org/wiki/Bank_card_number#Issuer_identification_number_.28IIN.29

reference/constraints/Choice.rst

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,14 @@ This is the message that you will receive if the ``multiple`` option is
338338
set to ``false`` and the underlying value is not in the valid array of
339339
choices.
340340

341+
You can use the following parameters in this message:
342+
343+
+------------------+------------------------------------------------+
344+
| Parameter | Description |
345+
+==================+================================================+
346+
| ``{{ value }}`` | The current (invalid) value |
347+
+------------------+------------------------------------------------+
348+
341349
multipleMessage
342350
~~~~~~~~~~~~~~~
343351

@@ -347,6 +355,14 @@ This is the message that you will receive if the ``multiple`` option is
347355
set to ``true`` and one of the values on the underlying array being checked
348356
is not in the array of valid choices.
349357

358+
You can use the following parameters in this message:
359+
360+
+------------------+------------------------------------------------+
361+
| Parameter | Description |
362+
+==================+================================================+
363+
| ``{{ value }}`` | The current (invalid) value |
364+
+------------------+------------------------------------------------+
365+
350366
minMessage
351367
~~~~~~~~~~
352368

@@ -355,6 +371,14 @@ minMessage
355371
This is the validation error message that's displayed when the user chooses
356372
too few choices per the `min`_ option.
357373

374+
You can use the following parameters in this message:
375+
376+
+------------------+------------------------------------------------+
377+
| Parameter | Description |
378+
+==================+================================================+
379+
| ``{{ limit }}`` | The lower limit of choices |
380+
+------------------+------------------------------------------------+
381+
358382
maxMessage
359383
~~~~~~~~~~
360384

@@ -363,6 +387,14 @@ maxMessage
363387
This is the validation error message that's displayed when the user chooses
364388
too many options per the `max`_ option.
365389

390+
You can use the following parameters in this message:
391+
392+
+------------------+------------------------------------------------+
393+
| Parameter | Description |
394+
+==================+================================================+
395+
| ``{{ limit }}`` | The upper limit of choices |
396+
+------------------+------------------------------------------------+
397+
366398
strict
367399
~~~~~~
368400

reference/constraints/Collection.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,14 @@ extraFieldsMessage
315315
The message shown if `allowExtraFields`_ is false and an extra field is
316316
detected.
317317

318+
You can use the following parameters in this message:
319+
320+
+------------------+------------------------------------------------+
321+
| Parameter | Description |
322+
+==================+================================================+
323+
| ``{{ field }}`` | The key of the extra field detected |
324+
+------------------+------------------------------------------------+
325+
318326
allowMissingFields
319327
~~~~~~~~~~~~~~~~~~
320328

@@ -333,4 +341,12 @@ missingFieldsMessage
333341
The message shown if `allowMissingFields`_ is false and one or more fields
334342
are missing from the underlying collection.
335343

344+
You can use the following parameters in this message:
345+
346+
+------------------+----------------------------------------------------+
347+
| Parameter | Description |
348+
+==================+====================================================+
349+
| ``{{ field }}`` | The key of the missing field defined in ``fields`` |
350+
+------------------+----------------------------------------------------+
351+
336352
.. include:: /reference/constraints/_payload-option.rst.inc

reference/constraints/Count.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,16 @@ minMessage
127127
The message that will be shown if the underlying collection elements count
128128
is less than the `min`_ option.
129129

130+
You can use the following parameters in this message:
131+
132+
+------------------+------------------------------------------------+
133+
| Parameter | Description |
134+
+==================+================================================+
135+
| ``{{ count }}`` | The current collection size |
136+
+------------------+------------------------------------------------+
137+
| ``{{ limit }}`` | The lower limit |
138+
+------------------+------------------------------------------------+
139+
130140
maxMessage
131141
~~~~~~~~~~
132142

@@ -135,6 +145,16 @@ maxMessage
135145
The message that will be shown if the underlying collection elements count
136146
is more than the `max`_ option.
137147

148+
You can use the following parameters in this message:
149+
150+
+------------------+------------------------------------------------+
151+
| Parameter | Description |
152+
+==================+================================================+
153+
| ``{{ count }}`` | The current collection size |
154+
+------------------+------------------------------------------------+
155+
| ``{{ limit }}`` | The upper limit |
156+
+------------------+------------------------------------------------+
157+
138158
exactMessage
139159
~~~~~~~~~~~~
140160

@@ -143,4 +163,14 @@ exactMessage
143163
The message that will be shown if min and max values are equal and the underlying
144164
collection elements count is not exactly this value.
145165

166+
You can use the following parameters in this message:
167+
168+
+------------------+------------------------------------------------+
169+
| Parameter | Description |
170+
+==================+================================================+
171+
| ``{{ count }}`` | The current collection size |
172+
+------------------+------------------------------------------------+
173+
| ``{{ limit }}`` | The exact expected collection size |
174+
+------------------+------------------------------------------------+
175+
146176
.. include:: /reference/constraints/_payload-option.rst.inc

reference/constraints/Country.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,14 @@ message
8585

8686
This message is shown if the string is not a valid country code.
8787

88+
You can use the following parameters in this message:
89+
90+
+------------------+------------------------------------------------+
91+
| Parameter | Description |
92+
+==================+================================================+
93+
| ``{{ value }}`` | The current (invalid) country code |
94+
+------------------+------------------------------------------------+
95+
8896
.. include:: /reference/constraints/_payload-option.rst.inc
8997

9098
.. _`ISO 3166-1 alpha-2`: https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes

reference/constraints/Currency.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,14 @@ message
8888

8989
This is the message that will be shown if the value is not a valid currency.
9090

91+
You can use the following parameters in this message:
92+
93+
+------------------+------------------------------------------------+
94+
| Parameter | Description |
95+
+==================+================================================+
96+
| ``{{ value }}`` | The current (invalid) value |
97+
+------------------+------------------------------------------------+
98+
9199
.. include:: /reference/constraints/_payload-option.rst.inc
92100

93101
.. _`3-letter ISO 4217`: https://en.wikipedia.org/wiki/ISO_4217

reference/constraints/Date.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,12 @@ message
8787

8888
This message is shown if the underlying data is not a valid date.
8989

90+
You can use the following parameters in this message:
91+
92+
+------------------+------------------------------------------------+
93+
| Parameter | Description |
94+
+==================+================================================+
95+
| ``{{ value }}`` | The current (invalid) value |
96+
+------------------+------------------------------------------------+
97+
9098
.. include:: /reference/constraints/_payload-option.rst.inc

reference/constraints/DateTime.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,12 @@ message
9696

9797
This message is shown if the underlying data is not a valid datetime.
9898

99+
You can use the following parameters in this message:
100+
101+
+------------------+------------------------------------------------+
102+
| Parameter | Description |
103+
+==================+================================================+
104+
| ``{{ value }}`` | The current (invalid) value |
105+
+------------------+------------------------------------------------+
106+
99107
.. include:: /reference/constraints/_payload-option.rst.inc

0 commit comments

Comments
 (0)