You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like that I would be able to edit them in VSCode with all $refs resolving to their local counterparts. This can be done by VSCode parsing $id field and determining the mapping from the remote URL to local file based on $id.
The text was updated successfully, but these errors were encountered:
aeschli
changed the title
Local JSON schemas should find each other based on their id fields
[json] Local JSON schemas should find each other based on their id fields
Jan 2, 2022
Looking for this as well. I have a repository of schemas and documents using those schemas, except they're organized into file structures. This means whenever I go another folder deeper into my documents, I have to add a ../ to the $schema and $refs in my document to reference the same local file. It would be nice to have all schemas in a workspace loaded to a list by their $ids that you can auto-complete when you start typing in your domain name in a $ref or $schema.
I'm also looking for a simple solution for my JSON schemas to be resolved locally and I wanted to collect my findings.
It was suggested in a related issue (#174672) to use the json.schemas setting with the file:// protocol. However, I didn't manage to have VSCode load the correct schema when trying to reference a relative file since:
Relative paths are not possible with a file:// protocol
Using relative paths directly will simply be appended to the HTTPS URI (I'm not sure if this is an expected behavior)
As a note, it is possible to use fileMatch field but requires a specific path naming convention which is not always desired.
Resolving all schema by IDs as suggested by this issue would be the simplest! An alternative could be to go in the direction suggested by #166438 and leverage the $ref field within the json.schemas configuration field.
I have a JSON schema which looks like:
I would like that I would be able to edit them in VSCode with all
$ref
s resolving to their local counterparts. This can be done by VSCode parsing$id
field and determining the mapping from the remote URL to local file based on$id
.The text was updated successfully, but these errors were encountered: