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

Cannot load http://json-schema.org/draft-07/schema #146

Closed
smoya opened this issue Oct 28, 2021 · 4 comments · Fixed by #152
Closed

Cannot load http://json-schema.org/draft-07/schema #146

smoya opened this issue Oct 28, 2021 · 4 comments · Fixed by #152
Labels
bug Something isn't working

Comments

@smoya
Copy link
Member

smoya commented Oct 28, 2021

Describe the bug

Current version of the Studio can't load http://json-schema.org/draft-07/schema when deployed in production.
This causes a warning on the editor such as:
Warning

How to Reproduce

Go to https://studio.asyncapi.com and load any AsyncAPI File.

Expected behavior

Warning should not be there.

The error is due to the fact the app is trying to load a http resource when the whole HTML has been loaded through https. This is illegal. In fact, the developer console is pretty clear:

​ Mixed Content: The page at 'https://studio.asyncapi.com/js/monaco/yaml.worker.bundle.js' was loaded over HTTPS, but requested an insecure resource 'http://json-schema.org/draft-07/schema'. This request has been blocked; the content must be served over HTTPS.

Developer console error

It seems we can provide a valid schema via monaco-yaml settings: https://github.com/remcohaszing/monaco-yaml/blob/main/index.d.ts#L4-L25

@smoya smoya added the bug Something isn't working label Oct 28, 2021
@magicmatatjahu
Copy link
Member

The problem is in https://github.com/asyncapi/spec-json-schemas/blob/master/schemas/2.2.0.json#L3 line, monaco-yaml try to resolve all external schemas from given version of AsyncAPI spec, so I think that we should create PR for specs, not for Studio.

@smoya
Copy link
Member Author

smoya commented Oct 28, 2021

The problem is in https://github.com/asyncapi/spec-json-schemas/blob/master/schemas/2.2.0.json#L3 line, monaco-yaml try to resolve all external schemas from given version of AsyncAPI spec, so I think that we should create PR for specs, not for Studio.

What about using always https on all our schemas $schema field urls?

@magicmatatjahu
Copy link
Member

What about using always https on all our schemas $schema field urls?

I had in mind that when I wrote my comment 😄

@smoya
Copy link
Member Author

smoya commented Oct 29, 2021

A PR has been created with the fix asyncapi/spec-json-schemas#115. Once merged, I guess we will need to redeploy the Studio so It loads all fresh schemas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants