Skip to content

[DependencyInjection][Routing] Add JSON schema for validating and autocompleting YAML config files #61282

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

Open
wants to merge 1 commit into
base: 7.4
Choose a base branch
from

Conversation

nicolas-grekas
Copy link
Member

Q A
Branch? 7.4
Bug fix? no
New feature? yes
Deprecations? no
Issues #60572
License MIT

Related to #59620
This provides autocompletion/validation on IDEs that support JSON schema for YAML files, such as phpStorm.

These files have been generated by Gemini.
I see them as a starting point for the community, contributions welcomed for improving the files if needed.

For the record, I first tried converting our XSD files into JSON schema, but this doesn't work since the config layout in XML files is not the same as in YAML ones.

@nicolas-grekas

This comment was marked as resolved.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version number was never updated for the xsd file name. I think a shorter file name would be better as it needs to be in all the Yaml files that use it.

# $schema: ../../vendor/symfony/dependency-injection/Loader/schema/dic/services/services-1.0.schema.json

Maybe:

# $schema: ../../vendor/symfony/dependency-injection/Loader/schema/services.schema.json

Copy link
Member Author

@nicolas-grekas nicolas-grekas Jul 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could also host those files on symfony.com so that the link could always be absolute?

@OskarStark
Copy link
Contributor

Little bit off topic, but what do you think about a JsonSchema component? we could also reuse this in symfony/ai

@GromNaN

This comment was marked as outdated.

@nicolas-grekas

This comment was marked as outdated.

@nicolas-grekas
Copy link
Member Author

what do you think about a JsonSchema component

not mine to write, that typically the kind of stuff I'd rather outsource to another lib

@GromNaN

This comment was marked as resolved.

@nicolas-grekas

This comment was marked as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy