Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[json] External schemas referenced from schema not updated #45207

Open
fxedel opened this issue Mar 7, 2018 · 7 comments
Open

[json] External schemas referenced from schema not updated #45207

fxedel opened this issue Mar 7, 2018 · 7 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug json JSON support issues
Milestone

Comments

@fxedel
Copy link

fxedel commented Mar 7, 2018

Issue Type

Bug

Description

Setup

color-schema.json

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  
  "validColors": {
    "enum": ["Red"]
  }
}

schema.json

{
  "$schema": "http://json-schema.org/draft-07/schema#",

  "type": "object",
  "properties": {
    "color": { "$ref": "color-schema.json#/validColors" }
  },
  "required": ["color"]
}

test.json

{
  "$schema": "./schema.json",
  "color": "Red"
}

Test 1: Intellisense notices changes in schema.json

Rename the property color to colorx in schema.json -> (Desired) error in test.json: Missing property "colorx".

✔️ That work's!

Test 2: Intellisense does not notice changes in color-schema.json

Change Red to Yellow in color-schema.json -> no errors!

Restarting VSCode finally gives the desired error in test.json: Value is not accepted. Valid values: "Yellow".

❌ That doesn't work! (i. e. at least without restarting VSCode after each schema dependency change)

VS Code Info

VS Code version: Code 1.20.1 (f88bbf9, 2018-02-13T15:31:21.019Z)
OS version: Linux x64 4.13.0-36-generic

System Info
Item Value
CPUs Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz (4 x 2194)
Load (avg) 1, 1, 1
Memory (System) 7.71GB (1.54GB free)
Process Argv /usr/share/code/code --unity-launch
Screen Reader no
VM 0%
Extensions (6)
Extension Author (truncated) Version
calculate aca 2.0.0
QML bbe 1.0.0
Kotlin mat 1.5.0
cpptools ms- 0.15.0
vetur oct 0.11.7
enumerator swi 0.0.6
Reproduces without extensions
@vscodebot vscodebot bot added the json JSON support issues label Mar 7, 2018
@microsoft microsoft deleted a comment from vscodebot bot Mar 8, 2018
@aeschli
Copy link
Contributor

aeschli commented Mar 8, 2018

You probably don't need to restart, but making a change in schema.json should update the scheme.
But yes, it's a bug.

@aeschli aeschli added the bug Issue identified by VS Code Team member as probable bug label Mar 8, 2018
@aeschli aeschli added this to the Backlog milestone Mar 8, 2018
@aeschli aeschli changed the title External schemas referenced from schema not updated [json] External schemas referenced from schema not updated Mar 8, 2018
@fxedel
Copy link
Author

fxedel commented Mar 8, 2018

@aeschli: Forgot to mention that changing schema.json doesn't reload its dependencies. The only way to do this is editing the $ref tag.

@Logerfo
Copy link
Contributor

Logerfo commented Oct 23, 2020

Any update on this topic?

@ehawman-rosenberg
Copy link

ehawman-rosenberg commented May 6, 2022

@Logerfo Hello from the future. They added an option called "JSON: Clear schema cache" which does the trick now.

image

The best part is that this is just one of many threads on this subject, none of which mentions this "screw it, just reset it yourselves" fix.

@terryaney
Copy link

@Logerfo Hello from the future. They added an option called "JSON: Clear schema cache" which does the trick now.

image

The best part is that this is just one of many threads on this subject, none of which mentions this "screw it, just reset it yourselves" fix.

Still doesn't work for me :(

@Infiniti20
Copy link

Same

@Xterionix
Copy link

Still an issue, I tried the JSON: Clear schema cache to no avail

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug json JSON support issues
Projects
None yet
Development

No branches or pull requests

8 participants
@terryaney @aeschli @fxedel @Logerfo @Xterionix @Infiniti20 @ehawman-rosenberg and others