The association of JSON schemas to files is done in the settings (File, Preferences, User Settings or Workspace Settings), under the property 'json.schemas'.
This is an example how the JSON schema for bower is associated to the bower schema.
"json.schemas": [
{
"fileMatch": [
"/bower.json",
"/.bower.json"
],
"url": "http://json.schemastore.org/bower"
},
...
You can also use schemas located in your workspace or define a schema right in the settings itself. Check https://code.visualstudio.com/docs/languages/json for examples.
Answer from Martin Aeschlimann on Stack OverflowThe association of JSON schemas to files is done in the settings (File, Preferences, User Settings or Workspace Settings), under the property 'json.schemas'.
This is an example how the JSON schema for bower is associated to the bower schema.
"json.schemas": [
{
"fileMatch": [
"/bower.json",
"/.bower.json"
],
"url": "http://json.schemastore.org/bower"
},
...
You can also use schemas located in your workspace or define a schema right in the settings itself. Check https://code.visualstudio.com/docs/languages/json for examples.
You can refer your JSON Schema in $schema node and get your intellisense in VS Code right away. No need to configure anywhere else.
For example,
{
"$schema": "http://json.schemastore.org/coffeelint",
"line_endings": "unix"
}

This is the intellisense I was talking about. JSON Schema has the list of possible JSON properties in your current cursor position and VS Code can pull out that list of intellisense.
Note that, every official JSON should have a concrete JSON Schema to prove the data integrity. This answer is still valid!
I found out it's possible to provide those JSON Schemas. In settings.json there are a couple of examples for Bower and package.json
They are under "json.schemas".
If you're trying to set the schema for a JSON file that should be using VSCode's settings schema, you can find your editor's current schema at vscode://schemas/settings/user.
To set that as the active schema for a JSON file, you could add this to the file:
"$schema": "vscode://schemas/settings/user",
Go into File > Preferences > Settings, search for JSON and find the following setting: JSON > Schema Download: Enable
If you toggle that off and on VS Code will grab the latest version of the schema files.
Very quick workaround to force vs code to reload the file: add a dummy parameter at the end of the schema url, e.g.
{"$schema": "file:///home/user/foo.json"}
becomes
{"$schema": "file:///home/user/foo.json?dummy=1"}
For yaml files:
# yaml-language-server: $schema=file:///home/user/foo.json?dummy=1