Open
Description
Description
In order to provide a similar experience to developers writing service and route config files in Yaml, we can add a JSON-schema file. That would enable completion and validation in the IDE.
- Services: https://github.com/symfony/symfony/blob/7.3/src/Symfony/Component/DependencyInjection/Loader/schema/dic/services/services-1.0.xsd
- Routing: https://github.com/symfony/symfony/blob/7.3/src/Symfony/Component/Routing/Loader/schema/routing/routing-1.0.xsd
- Validation: https://github.com/symfony/symfony/blob/7.3/src/Symfony/Component/Validator/Mapping/Loader/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd
We will not hit the issue encountered in #59620 because the schema will be hand written.
Example
In config/services.yaml
, add a link to the schema file to get it validated.
# $schema: ../vendor/symfony/dependency-injection/Loader/schema/dic/services/services.schema.json
parameters:
...
services:
...