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 Overflow
🌐
Visual Studio Code
code.visualstudio.com › docs › languages › json
Editing JSON with Visual Studio Code
November 3, 2021 - The association of a JSON file to a schema can be done either in the JSON file itself using the $schema attribute, or in the User or Workspace settings (File > Preferences > Settings) under the property json.schemas Open in VS Code Open in VS ...
🌐
GitHub
github.com › microsoft › vscode › issues › 76744
json schema defined in local file configured via json.schema in user settings.json is ignored · Issue #76744 · microsoft/vscode
July 5, 2019 - Move the same json.schemas configuration to the workspace .vscode/settings.json and the same Json file immediately starts being validated by the schema.
Author   jan-dolejsi
🌐
GitHub
github.com › microsoft › vscode › issues › 174672
Map JSON schema URLs to local file · Issue #174672 · microsoft/vscode
February 17, 2023 - I don't want to list all the JSON data files in fileMatch entries in my settings.json (because that would be hard to maintain), and rather want to add something like "$schema": "http://thecompany.com/schemas/foo_project/bar_schema.json" to each JSON data file. But I cannot make that URL resolvable (I cannot put files onto our website); so I'd like to specify somewhere that JSON schema URL http://thecompany.com/schemas/foo_project/bar_schema.json should resolve to the ./schemas/bar_schema.json file in the current project.
Author   oliver
🌐
Joshuatz
docs.joshuatz.com › cheatsheets › js › json-schema
JSON Schema - Resources, Notes, and VSCode Tips | Joshua's Docs
This is how bundled language extensions that come with VSCode, like configuration-editing, internally contribute schema resolvers (example) Note: For the $schema or url value, the path to the schema file does not have to be local; many extensions and plugins use a public URL, such as http://json.schemastore.org/eslintrc.
🌐
Netlify
nickymeuleman.netlify.app › blog › json-schema
JSON-schemas are awesome | Nicky Meuleman
// in VSCode workspace settings .json file (ctrl/cmd+shift+p to search for it) ... A schema doesn’t need to be remote. You can also link your file of choice to a self written and/or local schema.
Find elsewhere
🌐
YouTube
youtube.com › code 2020
VS Code tips — JSON schemas for IntelliSense - YouTube
Set the "$scheme" property in any json file to apply a schema to it. Schemas validate your json and provide IntelliSense while writing it.The "$schema" can b...
Published   November 15, 2020
Views   17K
🌐
Read the Docs
vscode-docs.readthedocs.io › en › stable › languages › json
Json - vscode-docs
JSON schemas are identified by an http or https location URL, servers like http://schemastore.org provide schemas for most of the common JSON based configuration files.
🌐
DEV Community
dev.to › brpaz › how-to-create-your-own-auto-completion-for-json-and-yaml-files-on-vs-code-with-the-help-of-json-schema-k1i
How to create your own auto-completion for JSON and YAML files on VS Code with the help of JSON Schema - DEV Community
April 27, 2020 - Probably the best way to start is to look at the project documentation or for example files. Some projects provide example files with all the possible values and you can infer the schema from there. In the case of Hadolint we can get everything needed from the project Readme. Next, we will create an hadolint.json file with the schema specification.
🌐
Frontaid
frontaid.io › blog › json-schema-vscode
How to set up JSON Schema with VSCode
The settings.json will be opened with the corresponding setting already prefilled. The fileMatch property is a list of file name patters that should be validated against the schema. The url property allows you to define the address of the schema. As currently only local files seem to work, you have to point it to the right path prefixed by file:.
🌐
Hex-rays
community.hex-rays.com › ida general
Using JSON Schema in Visual Studio Code for `ida-plugin.json` - IDA General - Hex-Rays Community forum
July 20, 2025 - Visual Studio Code provides out of the box support for JSON files, including features like validation and auto-completion. To enhance your experience with the ida-plugin.json file, you can use a JSON schema that defines …
🌐
GitHub
github.com › Microsoft › vscode › issues › 6974
[json] $schema attribute - strange path resolution behavior when referencing local schema file · Issue #6974 · microsoft/vscode
Create the following JSON files in a separate directory that is not contained in the directory from step 1. ... { "$schema": "http://json-schema.org/draft-04/schema#", "definitions": { "theme": { "enum": [ "red", "green" ] } }, "type": "object", "properties": { "theme": { "$ref": "#/definitions/theme" } }, "required": [ "theme" ] }
🌐
CodeGenes
codegenes.net › blog › vscode-unable-to-load-schema-for-package-json
VS Code Error: Unable to Load Schema for package.json (Local File Issue) – How to Fix & Resolve
What Causes the “Unable to Load Schema” Error (Local File Issues)? ... VS Code uses JSON schemas to validate package.json. By default, it fetches the official package.json schema from the JSON Schema Store (a remote server).