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

Unable to load remote schema with http protocol #550

Closed
1 of 4 tasks
Graham42 opened this issue Jul 8, 2021 · 7 comments · Fixed by redhat-developer/yaml-language-server#505
Closed
1 of 4 tasks
Assignees
Labels

Comments

@Graham42
Copy link

Graham42 commented Jul 8, 2021

Describe the bug

The latest version, 0.21.0 introduced a bug if a yaml file uses

# yaml-language-server: $schema=http://json-schema.org/draft-07/schema#

An error is shown

Unable to load schema from '/project/root/dir/http:/json-schema.org/draft-07/schema#': .YAML(768)

Expected Behavior

The remote schema should be loaded

Current Behavior

An error is reported

Steps to Reproduce

  1. Upgrade to 0.21.0
  2. Create a yaml file with the contents
    # yaml-language-server: $schema=http://json-schema.org/draft-07/schema#
    
    properties:
      foo:
        type: string

Environment

  • Windows
  • Mac
  • Linux
  • other (please specify)

Workaround

  1. In the Extensions tab, find the YAML plugin
  2. Open the menu for the plugin (Gear Icon)
  3. Choose 'Install Another Version'
  4. Install version 0.20.0
@Graham42 Graham42 changed the title Unable to load schema http protocol Unable to load remote schema with http protocol Jul 8, 2021
@JPinkney JPinkney added the bug label Jul 8, 2021
@JPinkney
Copy link
Contributor

JPinkney commented Jul 8, 2021

Can confirm this is happening. I think the issue is occurring because of redhat-developer/yaml-language-server#499

@electriquo
Copy link

it happens either for macos and https (not only http).

@aariacarterweir
Copy link

Second this

@simax
Copy link

simax commented Nov 9, 2021

Still happening with version 1.1.1 on windows 10 and https:

Unable to load schema from 'https://unpkg.com/%40graphql-mesh/types/config-schema.json': Request vscode/content failed unexpectedly without providing any details.YAML(768)

@evidolob
Copy link
Collaborator

evidolob commented Nov 9, 2021

@simax https://unpkg.com/%40graphql-mesh/types/config-schema.json redirects to /@graphql-mesh/[email protected]/config-schema.json for some reasons redirects is not supported, issue for this #586

@simax
Copy link

simax commented Nov 9, 2021

@evidolob Thanks. I'm a bit confused as to what to do to fix my problem.
The work around at #586 seems to suggest I should create a .vscode/setting.json, but in my case with the following contents:

{
  "yaml.schemas": {
    "https://unpkg.com/@graphql-mesh/[email protected]/config-schema.json": "graphql.config.yml"
  }
}

or

{
  "yaml.schemas": {
    "https://unpkg.com/%40graphql-mesh/types/config-schema.json": "graphql.config.yml"
  }
}

Should I also create a graphql.config.yml?
Should that file have the contents or @graphql-mesh/[email protected]/config-schema.json in it or remain empty?
Should the .vscode/setting.json be called settings.json (as stated in #586 ) or settingS.json ?

If so, I've tried the above but it didn't seem to help.

@evidolob
Copy link
Collaborator

evidolob commented Nov 9, 2021

@simax you need to create .vscode/settings.json, and put your configuration there.
Format and options are described in associating-a-schema.

{
  "yaml.schemas": {
    "https://unpkg.com/@graphql-mesh/[email protected]/config-schema.json": "graphql.config.yml"
  }
}

Should work, but you need to create and open graphql.config.yml file in vscode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants