Skip to content

Conversation

@nicolas-grekas
Copy link
Member

@nicolas-grekas nicolas-grekas commented Jul 31, 2025

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.

Note that this cannot support yaml tags, so no autocompletion after !service for example.
The only way to provide this would be to ship a language server. Out of reach I fear.

Recipe update at symfony/recipes#1447

@nicolas-grekas

This comment was marked as resolved.

@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.

Copy link
Member

@HypeMC HypeMC left a comment

Choose a reason for hiding this comment

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

I've noticed a few issues while testing.

@nicolas-grekas
Copy link
Member Author

PR updated.
Note that this cannot support yaml tags, so no autocompletion after !service for example.
The only way to provide this would be to ship a language server. Out of reach I fear.

Copy link
Member

@alexandre-daubois alexandre-daubois left a comment

Choose a reason for hiding this comment

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

Works really nicely, TIL JSON schemas can be used for YAML.

The Symfony extension is going to be retired 🙂

Image

@fabpot
Copy link
Member

fabpot commented Aug 22, 2025

Thank you @nicolas-grekas.

fabpot added a commit that referenced this pull request Aug 31, 2025
… and autocompleting YAML config files (nicolas-grekas)

This PR was merged into the 7.4 branch.

Discussion
----------

[Serializer][Validator] Add JSON schema for validating and autocompleting YAML config files

| Q             | A
| ------------- | ---
| Branch?       | 7.4
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Issues        | -
| License       | MIT

Same as #61282 but for serialization and validation metadata.

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

We need to remember updating the serialization schema when context builders are updated.

Commits
-------

f3ff89a [Serializer][Validator] Add JSON schema for validating and autocompleting YAML config files
This was referenced Oct 27, 2025
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.

7 participants