|
| 1 | +--- |
| 2 | +title: "Edit JSON files with vscode" |
| 3 | +description: "edit json files locally" |
| 4 | +bookCollapseSection: true |
| 5 | +--- |
| 6 | + |
| 7 | +# Edit JSON files with vscode |
| 8 | + |
| 9 | +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. |
| 10 | + |
| 11 | +Schemas: |
| 12 | + |
| 13 | +* [content-json-schema.json](/teddyCloud/tecdoc/content-json-schema.json) |
| 14 | +* [tonies-custom-json-schema.json](/teddyCloud/tecdoc/tonies-custom-json-schema.json) |
| 15 | +* [tonieboxes-custom-json-schema.json](/teddyCloud/tecdoc/tonieboxes-custom-json-schema.json) |
| 16 | +* [plalist-tap-json-schema.json](/teddyCloud/tecdoc/plalist-tap-json-schema.json) |
| 17 | + |
| 18 | +## content.json |
| 19 | + |
| 20 | +Add the Schemaurl to the json file. |
| 21 | + |
| 22 | +Example: |
| 23 | + |
| 24 | +```json |
| 25 | +{ |
| 26 | + "$schema": "{{< siteurl >}}teddyCloud/tecdoc/content-json-schema.json", |
| 27 | + "live": false, |
| 28 | + "nocloud": false, |
| 29 | + "source": "", |
| 30 | + "skip_seconds": 0, |
| 31 | + "cache": false, |
| 32 | + "cloud_ruid": "", |
| 33 | + "cloud_auth": "", |
| 34 | + "cloud_override": false, |
| 35 | + "tonie_model": "", |
| 36 | + "_version": 5 |
| 37 | +} |
| 38 | + |
| 39 | +``` |
| 40 | + |
| 41 | +## tonies.custom.json / tonieboxes.custom.json |
| 42 | + |
| 43 | +To configure this for vscode you have to edit `.vscode/settings.json`. |
| 44 | + |
| 45 | +Add the following parts to the `settings.json`: |
| 46 | + |
| 47 | +```json |
| 48 | +{ |
| 49 | + "json.schemaDownload.enable": true, |
| 50 | + "json.schemas": [ |
| 51 | + { |
| 52 | + "fileMatch": ["tonies.custom.json"], |
| 53 | + "url": "{{< siteurl >}}teddyCloud/tecdoc/tonies-custom-json-schema.json" |
| 54 | + }, |
| 55 | + { |
| 56 | + "fileMatch": ["tonieboxes.custom.json"], |
| 57 | + "url": "{{< siteurl >}}teddyCloud/tecdoc/tonieboxes-custom-json-schema.json" |
| 58 | + } |
| 59 | + ] |
| 60 | +} |
| 61 | +``` |
| 62 | + |
| 63 | +## Plalist (TAP) Files |
| 64 | + |
| 65 | +```json |
| 66 | +{ |
| 67 | + "$schema": "{{< siteurl >}}teddyCloud/tecdoc/plalist-tap-json-schema.json", |
| 68 | + "type": "tap", |
| 69 | + "audio_id": 0, |
| 70 | + "filepath": "lib://by/tapID/radio.taf", |
| 71 | + "name": "Radio", |
| 72 | + "files": [ |
| 73 | + { |
| 74 | + "filepath": "lib://by/audioID/1234567890.taf", |
| 75 | + "name": "Hörspiel Tonie" |
| 76 | + }, |
| 77 | + { |
| 78 | + "filepath": "lib://mp3/album/title.mp3", |
| 79 | + "name": "A Song" |
| 80 | + }, |
| 81 | + { |
| 82 | + "filepath": "http://nas.intranet/musiclibrary/album/song.mp3", |
| 83 | + "name": "Network Audio" |
| 84 | + } |
| 85 | + ] |
| 86 | +} |
| 87 | +``` |
0 commit comments