Skip to content

Added documentation for constraint message parameters #10617

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions reference/constraints/Bic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@ message

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

You can use the following parameters in this message:

+------------------+------------------------------------------------+
| Parameter | Description |
+==================+================================================+
| ``{{ value }}`` | The current (invalid) BIC value |
+------------------+------------------------------------------------+

.. include:: /reference/constraints/_payload-option.rst.inc

.. _`Business Identifier Code (BIC)`: https://en.wikipedia.org/wiki/Business_Identifier_Code
8 changes: 8 additions & 0 deletions reference/constraints/Blank.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,12 @@ message

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

You can use the following parameters in this message:

+------------------+------------------------------------------------+
| Parameter | Description |
+==================+================================================+
| ``{{ value }}`` | The current (invalid) value |
+------------------+------------------------------------------------+

.. include:: /reference/constraints/_payload-option.rst.inc
8 changes: 8 additions & 0 deletions reference/constraints/CardScheme.rst
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,14 @@ message

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

You can use the following parameters in this message:

+------------------+------------------------------------------------+
| Parameter | Description |
+==================+================================================+
| ``{{ value }}`` | The current (invalid) value |
+------------------+------------------------------------------------+

.. include:: /reference/constraints/_payload-option.rst.inc

.. _`Wikipedia: Issuer identification number (IIN)`: https://en.wikipedia.org/wiki/Bank_card_number#Issuer_identification_number_.28IIN.29
32 changes: 32 additions & 0 deletions reference/constraints/Choice.rst
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,14 @@ This is the message that you will receive if the ``multiple`` option is
set to ``false`` and the underlying value is not in the valid array of
choices.

You can use the following parameters in this message:

+------------------+------------------------------------------------+
| Parameter | Description |
+==================+================================================+
| ``{{ value }}`` | The current (invalid) value |
+------------------+------------------------------------------------+

multipleMessage
~~~~~~~~~~~~~~~

Expand All @@ -344,6 +352,14 @@ This is the message that you will receive if the ``multiple`` option is
set to ``true`` and one of the values on the underlying array being checked
is not in the array of valid choices.

You can use the following parameters in this message:

+------------------+------------------------------------------------+
| Parameter | Description |
+==================+================================================+
| ``{{ value }}`` | The current (invalid) value |
+------------------+------------------------------------------------+

minMessage
~~~~~~~~~~

Expand All @@ -352,6 +368,14 @@ minMessage
This is the validation error message that's displayed when the user chooses
too few choices per the `min`_ option.

You can use the following parameters in this message:

+------------------+------------------------------------------------+
| Parameter | Description |
+==================+================================================+
| ``{{ limit }}`` | The lower limit of choices |
+------------------+------------------------------------------------+

maxMessage
~~~~~~~~~~

Expand All @@ -360,6 +384,14 @@ maxMessage
This is the validation error message that's displayed when the user chooses
too many options per the `max`_ option.

You can use the following parameters in this message:

+------------------+------------------------------------------------+
| Parameter | Description |
+==================+================================================+
| ``{{ limit }}`` | The upper limit of choices |
+------------------+------------------------------------------------+

strict
~~~~~~

Expand Down
16 changes: 16 additions & 0 deletions reference/constraints/Collection.rst
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,14 @@ extraFieldsMessage
The message shown if `allowExtraFields`_ is false and an extra field is
detected.

You can use the following parameters in this message:

+------------------+------------------------------------------------+
| Parameter | Description |
+==================+================================================+
| ``{{ field }}`` | The key of the extra field detected |
+------------------+------------------------------------------------+

allowMissingFields
~~~~~~~~~~~~~~~~~~

Expand All @@ -337,4 +345,12 @@ missingFieldsMessage
The message shown if `allowMissingFields`_ is false and one or more fields
are missing from the underlying collection.

You can use the following parameters in this message:

+------------------+----------------------------------------------------+
| Parameter | Description |
+==================+====================================================+
| ``{{ field }}`` | The key of the missing field defined in ``fields`` |
+------------------+----------------------------------------------------+

.. include:: /reference/constraints/_payload-option.rst.inc
30 changes: 30 additions & 0 deletions reference/constraints/Count.rst
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,16 @@ minMessage
The message that will be shown if the underlying collection elements count
is less than the `min`_ option.

You can use the following parameters in this message:

+------------------+------------------------------------------------+
| Parameter | Description |
+==================+================================================+
| ``{{ count }}`` | The current collection size |
+------------------+------------------------------------------------+
| ``{{ limit }}`` | The lower limit |
+------------------+------------------------------------------------+

maxMessage
~~~~~~~~~~

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

You can use the following parameters in this message:

+------------------+------------------------------------------------+
| Parameter | Description |
+==================+================================================+
| ``{{ count }}`` | The current collection size |
+------------------+------------------------------------------------+
| ``{{ limit }}`` | The upper limit |
+------------------+------------------------------------------------+

exactMessage
~~~~~~~~~~~~

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

You can use the following parameters in this message:

+------------------+------------------------------------------------+
| Parameter | Description |
+==================+================================================+
| ``{{ count }}`` | The current collection size |
+------------------+------------------------------------------------+
| ``{{ limit }}`` | The exact expected collection size |
+------------------+------------------------------------------------+

.. include:: /reference/constraints/_payload-option.rst.inc
8 changes: 8 additions & 0 deletions reference/constraints/Country.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ message

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

You can use the following parameters in this message:

+------------------+------------------------------------------------+
| Parameter | Description |
+==================+================================================+
| ``{{ value }}`` | The current (invalid) country code |
+------------------+------------------------------------------------+

.. include:: /reference/constraints/_payload-option.rst.inc

.. _`ISO 3166-1 alpha-2`: https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes
8 changes: 8 additions & 0 deletions reference/constraints/Currency.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,14 @@ message

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

You can use the following parameters in this message:

+------------------+------------------------------------------------+
| Parameter | Description |
+==================+================================================+
| ``{{ value }}`` | The current (invalid) value |
+------------------+------------------------------------------------+

.. include:: /reference/constraints/_payload-option.rst.inc

.. _`3-letter ISO 4217`: https://en.wikipedia.org/wiki/ISO_4217
8 changes: 8 additions & 0 deletions reference/constraints/Date.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,12 @@ message

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

You can use the following parameters in this message:

+------------------+------------------------------------------------+
| Parameter | Description |
+==================+================================================+
| ``{{ value }}`` | The current (invalid) value |
+------------------+------------------------------------------------+

.. include:: /reference/constraints/_payload-option.rst.inc
8 changes: 8 additions & 0 deletions reference/constraints/DateTime.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,12 @@ message

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

You can use the following parameters in this message:

+------------------+------------------------------------------------+
| Parameter | Description |
+==================+================================================+
| ``{{ value }}`` | The current (invalid) value |
+------------------+------------------------------------------------+

.. include:: /reference/constraints/_payload-option.rst.inc
8 changes: 8 additions & 0 deletions reference/constraints/Email.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,14 @@ message

This message is shown if the underlying data is not a valid email address.

You can use the following parameters in this message:

+------------------+------------------------------------------------+
| Parameter | Description |
+==================+================================================+
| ``{{ value }}`` | The current (invalid) value |
+------------------+------------------------------------------------+

checkMX
~~~~~~~

Expand Down
12 changes: 12 additions & 0 deletions reference/constraints/EqualTo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,16 @@ message

This is the message that will be shown if the value is not equal.

You can use the following parameters in this message:

+-------------------------------+-----------------------------+
| Parameter | Description |
+===============================+=============================+
| ``{{ value }}`` | The current (invalid) value |
+-------------------------------+-----------------------------+
| ``{{ compared_value }}`` | The expected value |
+-------------------------------+-----------------------------+
| ``{{ compared_value_type }}`` | The expected value type |
+-------------------------------+-----------------------------+

.. include:: /reference/constraints/_payload-option.rst.inc
8 changes: 8 additions & 0 deletions reference/constraints/Expression.rst
Original file line number Diff line number Diff line change
Expand Up @@ -252,4 +252,12 @@ message

The default message supplied when the expression evaluates to false.

You can use the following parameters in this message:

+-----------------+-----------------------------+
| Parameter | Description |
+=================+=============================+
| ``{{ value }}`` | The current (invalid) value |
+-----------------+-----------------------------+

.. include:: /reference/constraints/_payload-option.rst.inc
12 changes: 12 additions & 0 deletions reference/constraints/GreaterThan.rst
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,18 @@ message
This is the message that will be shown if the value is not greater than the
comparison value.

You can use the following parameters in this message:

+-------------------------------+-----------------------------+
| Parameter | Description |
+===============================+=============================+
| ``{{ value }}`` | The current (invalid) value |
+-------------------------------+-----------------------------+
| ``{{ compared_value }}`` | The lower limit |
+-------------------------------+-----------------------------+
| ``{{ compared_value_type }}`` | The expected value type |
+-------------------------------+-----------------------------+

.. include:: /reference/constraints/_payload-option.rst.inc

.. _`accepted by the DateTime constructor`: https://php.net/manual/en/datetime.formats.php
12 changes: 12 additions & 0 deletions reference/constraints/GreaterThanOrEqual.rst
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,18 @@ message
This is the message that will be shown if the value is not greater than or equal
to the comparison value.

You can use the following parameters in this message:

+-------------------------------+-----------------------------+
| Parameter | Description |
+===============================+=============================+
| ``{{ value }}`` | The current (invalid) value |
+-------------------------------+-----------------------------+
| ``{{ compared_value }}`` | The lower limit |
+-------------------------------+-----------------------------+
| ``{{ compared_value_type }}`` | The expected value type |
+-------------------------------+-----------------------------+

.. include:: /reference/constraints/_payload-option.rst.inc

.. _`accepted by the DateTime constructor`: https://php.net/manual/en/datetime.formats.php
8 changes: 8 additions & 0 deletions reference/constraints/Iban.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,14 @@ message

The default message supplied when the value does not pass the Iban check.

You can use the following parameters in this message:

+-----------------+-----------------------------+
| Parameter | Description |
+=================+=============================+
| ``{{ value }}`` | The current (invalid) value |
+-----------------+-----------------------------+

.. include:: /reference/constraints/_payload-option.rst.inc

.. _`International Bank Account Number (IBAN)`: https://en.wikipedia.org/wiki/International_Bank_Account_Number
12 changes: 12 additions & 0 deletions reference/constraints/IdenticalTo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,16 @@ message

This is the message that will be shown if the value is not identical.

You can use the following parameters in this message:

+-------------------------------+-----------------------------+
| Parameter | Description |
+===============================+=============================+
| ``{{ value }}`` | The current (invalid) value |
+-------------------------------+-----------------------------+
| ``{{ compared_value }}`` | The expected value |
+-------------------------------+-----------------------------+
| ``{{ compared_value_type }}`` | The expected value type |
+-------------------------------+-----------------------------+

.. include:: /reference/constraints/_payload-option.rst.inc
Loading