Don't use JSON schema when edition YAML file in Visual Studio Code

Viewed 1426

By default my Visual Studio Code uses a JSON schema definition when editing YAMl files. How to turn this off and simply use YAML syntax highlighting without specific JSON schema? In the schema selector there is not "No schema".

enter image description here

  • Visual Studio code 1.66.0
3 Answers

When you select the schema, there should be new file generated .vscode/settings.json

You can remove the related settings in the file under yaml.schemas.

you can disable auto yaml schema in settings, search for Yaml > Schema Store: Url and disable it

Like I mentioned in the comments, yaml support isn't currently a part of VS Code, but is part of an extension (like the Redhat Plugin). The config in this plugin follows a similar pattern for the built in json schema settings though.

The config is defined like this:

{
    ...
    "yaml.schemas": {
        "schema-filename.json": FILENAME or PATTERN or LIST OF FILENAMEs/PATTERNS
    }
    ...
}

I don't know if this helped but if you create a dummy schema file like this {"type": "object"}. You can reference that in the settings.

Also, I found that in addition to the user settings, the plugin was writing to the workspace settings. Fixing things in both places seemed to work.

Related