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 doesn't allow headers for schema #765

Closed
benkroeger opened this issue Sep 22, 2021 · 5 comments · Fixed by #1011
Closed

JSON Schema doesn't allow headers for schema #765

benkroeger opened this issue Sep 22, 2021 · 5 comments · Fixed by #1011
Assignees

Comments

@benkroeger
Copy link

Describe the bug
According to the documentation, you can pass headers to a schema url - and the feature itself actually works.
It's just that the provided json schema throws a validation error because it expects schema to either be a string or an array of strings

To Reproduce
set schema to

schema:
  - http://localhost:3000/graphql:
      headers:
        Authorization: foo

yaml schema validation against https://unpkg.com/[email protected]/config-schema.json will report the issue as follows:

image

Expected behavior
the documented format should be allowed in the json schema

Environment:

  • OS: MacOS 11.5.2
  • GraphQL Config Version: 4.0.1
  • NodeJS: 16.9.1

Additional context

benkroeger added a commit to benkroeger/graphql-config that referenced this issue Sep 23, 2021
@paleite
Copy link

paleite commented Sep 23, 2021

Experiencing the same issue

@Urigo
Copy link
Collaborator

Urigo commented Oct 28, 2021

Hi @benkroeger and thank you for the report

Sorry but I'm not adding a lot here but just labeling it according to our new Contribution Guide and issue flow.

It seems already got into stage 1 thanks to your reproduction! Thank you for that!

Now in order to advance to stage 2 we'll need a failing test, would be great if someone could help progress the issues through the stages.

Also we would love to PR to update the schema.

Thank you and sorry that this comment is not a complete solution (yet).

@Urigo Urigo added the stage/1-reproduction A reproduction exists label Oct 28, 2021
@dimaMachina dimaMachina self-assigned this Mar 30, 2022
@dimaMachina dimaMachina added stage/5-alpha-release-testing The pull request is merged, an alpha release is available, to be tested and removed stage/1-reproduction A reproduction exists labels Mar 31, 2022
@dimaMachina
Copy link
Collaborator

dimaMachina commented Mar 31, 2022

@benkroeger @paleite @zifeo @kevinalh @illarionvk @BasixKOR @frehner @franzwilhelm

Hey guys, sorry for a long time in fixing this problem.
This problem was finally solved in the alpha version [email protected].

I mentioned all of you because you had this problem, so you can test it on your configs, and maybe you have some suggestions for the next major of graphql-config? Please leave it in #626

@BasixKOR
Copy link

BasixKOR commented Apr 5, 2022

Note: You can test this by using custom schema options on VS Code YAML extension like this:

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

@dimaMachina dimaMachina removed the stage/5-alpha-release-testing The pull request is merged, an alpha release is available, to be tested label Apr 5, 2022
@dimaMachina
Copy link
Collaborator

@BasixKOR thanks, available in [email protected]

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