You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I keep coming across places around the web suggesting the yaml section in eclipse preferences -> YML. I am using the newest Eclipse, i.e. 2021-06. There is no YML section in the preferences.
Has this section been removed in favor of somewhere else? How is it possible to add a custom JSON schema from the JSON Schema Store for specific yaml files? In my case just swagger.yaml.
Is there a bug in the newest eclipse, i.e. is the YML section in preferences supposed to be there?
I did try messing around with the eclipse preferences -> General -> Schema Associations. However it seems I would have to create an eclipse plugin to register a new content type before I can associate a new schema.
I also tried out what is possible with eclipse preferences -> Language Servers, however this also seems to need eclipse plugin to do anything . . .
So is there any possible way in the new 2021-06 eclipse to register a new json schema for a specific yaml file without having to make an eclipse plugin?
It's not immediately obvious how to do this as a new user, but yes! You can have .yaml validation to a JSON schema. It just requires some tricky tweaking of your Eclipse installation.
For example, to configure `.bower.yml to match the bower JSON schema:
In General > Content Types, under Text > Wild Web Developer supported web dev file > YAML, create a new Child Bower YAML:
Add a file association path, e.g. *.bower.yml:
Now in the General > Schema Associations, create a new schema association from your new content type to the schema location:
Finally now when you open your .bower.yml files in the Generic Text Editor, you'll get validation warnings, and content assist:
As far as I can tell there's no way to store these settings in a specific project, so if you reinstall Eclipse you'll probably need to go through this again.
Activity
mickaelistria commentedon Jul 22, 2021
No, you can create your own content-types dynamically from the Content Type preference page.
soundasleep commentedon Nov 26, 2021
It's not immediately obvious how to do this as a new user, but yes! You can have .yaml validation to a JSON schema. It just requires some tricky tweaking of your Eclipse installation.
For example, to configure `.bower.yml to match the bower JSON schema:
In

General > Content Types, underText > Wild Web Developer supported web dev file > YAML, create a new ChildBower YAML:Add a file association path, e.g.

*.bower.yml:Now in the

General > Schema Associations, create a new schema association from your new content type to the schema location:Finally now when you open your


.bower.ymlfiles in theGeneric Text Editor, you'll get validation warnings, and content assist:As far as I can tell there's no way to store these settings in a specific project, so if you reinstall Eclipse you'll probably need to go through this again.