Vscode: [json] External schemas referenced from schema not updated

Created on 7 Mar 2018  ·  3Comments  ·  Source: microsoft/vscode

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".

:heavy_check_mark: 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".

:x: 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 (f88bbf9137d24d36d968ea6b2911786bfe103002, 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

bug json

Most helpful comment

Any update on this topic?

All 3 comments

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: Forgot to mention that changing schema.json doesn't reload its dependencies. The only way to do this is editing the $ref tag.

Any update on this topic?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DovydasNavickas picture DovydasNavickas  ·  3Comments

lukehoban picture lukehoban  ·  3Comments

vsccarl picture vsccarl  ·  3Comments

biij5698 picture biij5698  ·  3Comments

ryan-wong picture ryan-wong  ·  3Comments