microsoft / vscode-json-languageservice

JSON language service extracted from VSCode to be reused, e.g in the Monaco editor.
Other
261 stars 110 forks source link

JSON Schema meta-schemas should not be downloaded #212

Open gregsdennis opened 11 months ago

gregsdennis commented 11 months ago

Following on from https://github.com/microsoft/vscode/issues/195189, JSON Schema strongly recommends that implementations (including editors like this one) do not automatically download references, including meta-schemas.

Specifically, well-known meta-schemas should be packaged with the implementation.

It has been noted in the issue linked above that draft 4 and draft 7 meta-schemas are not downloaded, which is great. However as the others are used, VSCode's downloading of these files can apply considerable load on the JSON Schema website.

Further, URIs found in $id, $schema, and $ref are identifiers only, even when they happen to be URLs. JSON Schema generally discourages the interpretation of these as locators.

Understandably, if an unknown meta-schema is specified with $schema, an effort should be made to acquire it. In these cases, I recommend that an alert be surfaced to the user so that they can make the determination to attempt to download unknown meta-schemas. Any automatic download feature, if provided at all, should be disabled by default.