[json] External schemas referenced from schema not updated
See original GitHub issueIssue 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 (f88bbf9137d24d36d968ea6b2911786bfe103002, 2018-02-13T15:31:21.019Z) OS version: Linux x64 4.13.0-36-generic
System Info
Item | Value |
---|---|
CPUs | Intel® Core™ 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 |
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:5 (2 by maintainers)
Top Results From Across the Web
json - Resolver error when referencing external schema files
The error message is referencing the schema in "pet-full.schema.json", which you did not include here. – Ether. Oct 18, 2021 at 22:43.
Read more >Structuring a complex schema
It's possible to reference an external subschema, but generally you want to limit a $ref to referencing either an external schema or an...
Read more >Combining schemas
You can structure your validation logic across multiple schema files and have schemas reference each other using $ref keyword. Example:.
Read more >Loading Schemas
A JSON schema can reference external schemas. External references are typically a URL that points to where the external schema is publically hosted...
Read more >JSON Schema Bundling Finally Formalised
Ultimate source of truth matters, and it's often the JSON Schemas. Many tools don't support referencing external resources.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Any update on this topic?
@Logerfo Hello from the future. They added an option called “JSON: Clear schema cache” which does the trick now.
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.