Edit JSON files with vscode

Edit JSON files with vscode #

You can use a json schema which can provide you the ability for autocompletion and validation in your favorite editor. This article describes it for vscode.

Schemas:

content.json #

Add the Schemaurl to the json file.

Example:

{
    "$schema": "https://tonies-wiki.revvox.deteddyCloud/tecdoc/content-json-schema.json",
 "live": false,
 "nocloud": false,
 "source": "",
 "skip_seconds": 0,
 "cache": false,
 "cloud_ruid": "",
 "cloud_auth": "",
 "cloud_override": false,
 "tonie_model": "",
 "_version": 5
}

tonies.custom.json / tonieboxes.custom.json #

To configure this for vscode you have to edit .vscode/settings.json.

Add the following parts to the settings.json:

{
    "json.schemaDownload.enable": true,
    "json.schemas": [
        {
            "fileMatch": ["tonies.custom.json"],
            "url": "https://tonies-wiki.revvox.deteddyCloud/tecdoc/tonies-custom-json-schema.json"            
        },
        {
            "fileMatch": ["tonieboxes.custom.json"],
            "url": "https://tonies-wiki.revvox.deteddyCloud/tecdoc/tonieboxes-custom-json-schema.json"
        }
    ]
}

Plalist (TAP) Files #

{
  "$schema": "https://tonies-wiki.revvox.deteddyCloud/tecdoc/plalist-tap-json-schema.json",
  "type": "tap",
  "audio_id": 0,
  "filepath": "lib://by/tapID/radio.taf",
  "name": "Radio",
  "files": [
    {
      "filepath": "lib://by/audioID/1234567890.taf",
      "name": "Hörspiel Tonie"
    },
    {
      "filepath": "lib://mp3/album/title.mp3",
      "name": "A Song"
    },
    {
      "filepath": "http://nas.intranet/musiclibrary/album/song.mp3",
      "name": "Network Audio"
    }
  ]
}