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

Schema Does Not Load With URI myproto:///schema.json #232647

Closed
hediet opened this issue Oct 30, 2024 · 0 comments · Fixed by microsoft/vscode-json-languageservice#248
Closed
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug json JSON support issues verified Verification succeeded
Milestone

Comments

@hediet
Copy link
Member

hediet commented Oct 30, 2024

In some cases, schemas registered by jsonValidation are not picked up.

This works:

"jsonValidation": [
	{
		"fileMatch": "foo.json",
		"url": "myproto:///schema.json"
	}
]

This does not work, which is the actual bug:

"jsonValidation": [
	{
		"fileMatch": "foo.json",
		"url": "./randomSchema.json"
	},
	{
		"fileMatch": "foo.json",
		"url": "myproto:///schema.json"
	}
]

However, this works (notice someRandomNameThatMakesThisWork):

"jsonValidation": [
	{
		"fileMatch": "foo.json",
		"url": "./randomSchema.json"
	},
	{
		"fileMatch": "foo.json",
		"url": "myproto://someRandomNameThatMakesThisWork/schema2.json"
	}
]

This took an eternety to debug :/ (also, because source maps don't seem to work for the json language extension and debugging the JSON server without sources is very tricky)
It seems like when merging schemas, something goes wrong when one of the involved schemas does not have a root.
Also, I always run into

resolveErrors.push(l10n.t('Problems loading reference \'{0}\': {1}', loc, unresolvedSchema.errors[0]));

I'm fine with myproto:///schema.json not working, but then it should consistently not work and a nice error message should be printed somewhere.

@aeschli aeschli added this to the November 2024 milestone Oct 31, 2024
@aeschli aeschli added json JSON support issues bug Issue identified by VS Code Team member as probable bug labels Oct 31, 2024
@hediet hediet added the verified Verification succeeded label Dec 3, 2024
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Dec 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug json JSON support issues verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants