vscode provide link to json schem via extension

Viewed 331

I need to provide a json schema for other users without using the json schema store, for example if you look at the following link user are able to configure there own schema ,but here I want that every one who installing my vs-extension will have this jsonschema.

This is my question:

How should I link the user schema , for example for my internal usage what I did

"json.schemas": [
    {
        "fileMatch": [
            "/*.tzr.json"
        ],
        "url": "./tzrschema.json"
    }
]

I put the schema in my workspace and link it via url and it works for me,

Assume that my vs-ext is providing a folder with file tzrschema.json , how should I link the users workspace to the file that I’ve provided via extension ?

1 Answers

You should use the jsonValidation contribution point in package.json:

{
  "contributes": {
    "jsonValidation": [
      {
        "fileMatch": "/*.tzr.json",
        "url": "./tzrschema.json"
      }
    ]
  }
}
Related