Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reload local JSON schema in Visual Studio Code?

I'm developing a JSON schema and referenced it for tests in another project.

When I edit the JSON schema, changes are not applied until I reload the window in other project.

like image 617
sunknudsen Avatar asked Oct 16 '25 02:10

sunknudsen


2 Answers

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.

like image 101
user17555589 Avatar answered Oct 17 '25 20:10

user17555589


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
like image 20
tstenner Avatar answered Oct 17 '25 21:10

tstenner



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!