@@ -47,24 +47,6 @@ order to be valid. These rules are usually defined using PHP code or
4747attributes but they can also be defined as ``.yaml `` or ``.xml `` files inside
4848the ``config/validator/ `` directory.
4949
50- .. tip ::
51-
52- Symfony provides a JSON schema for validation mapping files that enables
53- autocompletion and validation in IDEs like PhpStorm. Add the following
54- ``$schema `` key at the beginning of your YAML files to enable this feature:
55-
56- .. code-block :: yaml
57-
58- # config/validator/validation.yaml
59- ' $schema ' : https://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.json
60- App\Entity\Author :
61- properties :
62- # your IDE will now provide autocompletion here...
63-
64- .. versionadded :: 7.4
65-
66- The JSON schema for validation mapping files was introduced in Symfony 7.4.
67-
6850For example, to indicate that the ``$name `` property must not be empty, add the
6951following:
7052
@@ -137,6 +119,24 @@ be passed to the validator service to be checked.
137119 get the value of any property, so they can be public, private or protected
138120 (see :ref: `validator-constraint-targets `).
139121
122+ .. tip ::
123+
124+ Symfony provides a JSON schema for validation mapping files that enables
125+ autocompletion and validation in IDEs like PhpStorm. Add the following
126+ ``$schema `` key at the beginning of your YAML files to enable this feature:
127+
128+ .. code-block :: yaml
129+
130+ # config/validator/validation.yaml
131+ ' $schema ' : https://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.json
132+ App\Entity\Author :
133+ properties :
134+ # your IDE will now provide autocompletion here...
135+
136+ .. versionadded :: 7.4
137+
138+ The JSON schema for validation mapping files was introduced in Symfony 7.4.
139+
140140Using the Validator Service
141141~~~~~~~~~~~~~~~~~~~~~~~~~~~
142142
0 commit comments