redhat-developer / redhat-developer/vscode-yaml
"Unable to load schema" when using `$id`
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 829
- Forks
- 260
- Avg merge
- 5h 43m
- Merged PRs (30d)
- 1
Description
Describe the bug
Problems loading reference 'http://emily.json/#a': Unable to load schema from 'http://emily.json/': Request vscode/content failed unexpectedly without providing any details. error.
when using $ref in:
{
"$id": "http://emily.json",
"$schema": "http://json-schema.org/draft-07/schema",
"type": "object",
"properties": {
"first": {
"$id": "#a",
"type": "boolean"
},
"second": {
"$ref": "http://emily.json#a"
}
}
}
Expected Behavior
Successful reference resolution.
Current Behavior
Failed resolution.
Steps to Reproduce
- Create schema.json with:
{
"$id": "http://emily.json",
"$schema": "http://json-schema.org/draft-07/schema",
"type": "object",
"properties": {
"first": {
"$id": "#a",
"type": "boolean"
},
"second": {
"$ref": "http://emily.json#a"
}
}
}
content.
- Create test.yaml with:
first: true
content.
- Create .vscode/settings.json with:
{
"yaml.schemas": {
"schema.json": "test.yaml"
}
}
content.
- Open test.yaml and obtain mentioned error
Environment
- Windows
- Mac
- Linux
- other (please specify)
Related issue
https://github.com/json-schema-org/json-schema-spec/issues/1398
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure with schema.json, test.yaml, and .vscode/settings.json, then read the related json-schema-spec issue 1398 for the expected $id and $ref behavior. Trace schema loading and reference resolution from opening test.yaml; done means the reference resolves without the reported error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100