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

Can not load schema file when the URL is redirected. #586

Closed
1 of 4 tasks
soumi-akira opened this issue Aug 25, 2021 · 3 comments · Fixed by #644
Closed
1 of 4 tasks

Can not load schema file when the URL is redirected. #586

soumi-akira opened this issue Aug 25, 2021 · 3 comments · Fixed by #644
Milestone

Comments

@soumi-akira
Copy link

soumi-akira commented Aug 25, 2021

Describe the bug

It seems the extension failed to load schema file from URL that is redirected.

e.g)

codeben.yml

Works fine. Loaded schema URL is https://www.schemastore.org/api/json/catalog.json

graphql.config.yml

Error. Loaded schema URL is https://unpkg.com/graphql-config/config-schema.json

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

The URL is redirected to

https://unpkg.com/[email protected]/config-schema.json

Expected Behavior

Load schema file even redirected.

Current Behavior

Throws error below, schema isn't loaded.

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

Steps to Reproduce

  1. create graphql.config.yml
  2. open graphql.config.yml

Environment

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

Workaround

create .vscode/setting.json

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

craigkc commented Sep 15, 2021

I ran into this issue today and appreciate the workaround. I wonder about the implications of a fix, since I could imagine it's coded to not follow redirects for reasons around security?

@Sly777
Copy link

Sly777 commented Oct 14, 2021

Thanks for the workaround! It helps a lot but definitely RedHat team needs to find solution for this :/

@evidolob
Copy link
Collaborator

This issue causes bug in request-light library which we use to download JSON Schema.
I provide PR to fix redirect support microsoft/node-request-light#8

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

Successfully merging a pull request may close this issue.

4 participants