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

json-schema.org/schema 404 #195189

Closed
6nv opened this issue Oct 9, 2023 · 8 comments · Fixed by microsoft/vscode-json-languageservice#211
Closed

json-schema.org/schema 404 #195189

6nv opened this issue Oct 9, 2023 · 8 comments · Fixed by microsoft/vscode-json-languageservice#211
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug json JSON support issues verified Verification succeeded
Milestone

Comments

@6nv
Copy link

6nv commented Oct 9, 2023

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.83.0
  • OS Version: MacOS Ventura 13.6

I've been getting a 404 not found error code from https://json-schema.org/schema in VS Code and in multiple different browsers, and on different networks. Additionally, VS code no longer provides intellisense when I use that schema URL.

Steps to Reproduce:

  1. Create <file>.json (for example, schema.json)
  2. Insert this code:
    {
        "$schema": "https://json-schema.org/schema"
    }
  3. Notice this error, and intellisense is not working:
    example
@gregsdennis
Copy link

This error is due to a revamped https://json-schema.org where we are only hosting HTTPS content. I believe we are serving a 301 from the meta-schema URLs, though.

Potential problems:

  1. http://json-schema.org/schema should never be used to identify a meta-schema. This is not a valid meta-schema URI. Historically this URL hosted the latest meta-schema, but that led to unpredictable behaviors as new versions were released and the "latest" was updated, so we decided to remove it.
  2. The value of $schema is to be interpreted as a URI, not a URL. If the value happens to also be a URL, it is not to be interpreted to actually be at that location. It is an identifier only.
  3. Implementations (including editors) should not be downloading well-known meta-schemas. They should be packaged with the implementation. (@6nv, does the problem still occur if you use http://json-schema.org/draft-07/schema# or another well-known meta-schema URI?)

@6nv
Copy link
Author

6nv commented Oct 9, 2023

Some updates after meeting with the json-schema team:

Here are some updates after the redirection was added, and restarting VS Code:

  • New error message Problems loading reference
  • Now, there are a few intellisense options (see image)
Screenshot 2023-10-09 at 2 06 11 PM Screenshot 2023-10-09 at 2 06 20 PM

@6nv
Copy link
Author

6nv commented Oct 9, 2023

Last thing to add here for now: By default, draft-04 and draft-07 begin with http instead of https, however using either http or https works just fine for these schemas.

Screenshot 2023-10-09 at 2 19 53 PM Screenshot 2023-10-09 at 2 20 17 PM

@benjagm
Copy link

benjagm commented Oct 10, 2023

however using either http or https works just fine for these schemas.

Yes, those redirections serves both http and https.

@aeschli
Copy link
Contributor

aeschli commented Oct 10, 2023

I verified that we do not use or propose http://json-schema.org/schema in vscode or the json language service.
I created a PR to access json-schema.org always with https.

@aeschli aeschli added this to the October 2023 milestone Oct 10, 2023
@aeschli aeschli added bug Issue identified by VS Code Team member as probable bug json JSON support issues labels Oct 10, 2023
@gregsdennis
Copy link

@aeschli please be aware that the /schema route will likely not be available much longer. We have decided to discontinue it as it does not nap to a known meta-schema.

Furthermore, could you verify that the published meta-schema URIs are not downloaded, please? They should be considered well-known and supported offline. These definitely SHOULD NOT be regularly accessed by download.

  • draft 4
  • draft 6
  • draft 7
  • draft 2019-09
  • draft 2020-12

We're not sure yet what the next iteration will be.

@gregsdennis
Copy link

@aeschli please confirm the other meta-schemas are not regularly downloaded. Otherwise this issue is NOT completed.

@aeschli
Copy link
Contributor

aeschli commented Oct 10, 2023

We currently have a copy of draft-4 and draft-7 so there is no download for these. Others are downloaded, but they are cached locally.
I think this should be covered in a new issue. Please file against https://github.com/microsoft/vscode-json-languageservice.

@mjbvz mjbvz added the verified Verification succeeded label Oct 24, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Nov 24, 2023
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.

5 participants