Skip to content

Commit cf08882

Browse files
committed
minor #16684 [Validator] Fix of the description of the mime type message option (mdoutreluingne)
This PR was squashed before being merged into the 6.1 branch. Discussion ---------- [Validator] Fix of the description of the mime type message option In this PR, I corrected the mistake I made [here.](#16663) I used the table of parameters of the `File` constraint to explain the different parameters in the `Image` constraint. Can you do a review please? `@fancyweb` ready for review :) Commits ------- b557833 [Validator] Fix of the description of the mime type message option
2 parents f620113 + b557833 commit cf08882

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

reference/constraints/File.rst

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -259,16 +259,7 @@ You can find a list of existing mime types on the `IANA website`_.
259259
The message displayed if the mime type of the file is not a valid mime type
260260
per the `mimeTypes`_ option.
261261

262-
You can use the following parameters in this message:
263-
264-
=============== ==============================================================
265-
Parameter Description
266-
=============== ==============================================================
267-
``{{ file }}`` Absolute file path
268-
``{{ name }}`` Base file name
269-
``{{ type }}`` The MIME type of the given file
270-
``{{ types }}`` The list of allowed MIME types
271-
=============== ==============================================================
262+
.. include:: /reference/constraints/_parameters-mime-types-message-option.rst.inc
272263

273264
``notFoundMessage``
274265
~~~~~~~~~~~~~~~~~~~

reference/constraints/Image.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,12 @@ You can find a list of existing image mime types on the `IANA website`_.
442442
``mimeTypesMessage``
443443
~~~~~~~~~~~~~~~~~~~~
444444

445-
**type**: ``string`` **default**: ``The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}.``
445+
**type**: ``string`` **default**: ``This file is not a valid image.``
446+
447+
The message ``The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}.`` will be displayed
448+
if the allowed `mimeTypes`_ are only a subset of ``image/*``.
449+
450+
.. include:: /reference/constraints/_parameters-mime-types-message-option.rst.inc
446451

447452
``minHeight``
448453
~~~~~~~~~~~~~
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
You can use the following parameters in this message:
2+
3+
=============== ==============================================================
4+
Parameter Description
5+
=============== ==============================================================
6+
``{{ file }}`` Absolute file path
7+
``{{ name }}`` Base file name
8+
``{{ type }}`` The MIME type of the given file
9+
``{{ types }}`` The list of allowed MIME types
10+
=============== ==============================================================

0 commit comments

Comments
 (0)