-
Notifications
You must be signed in to change notification settings - Fork 150
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
docs: Add server urls to swagger-ui #1330
Conversation
@@ -6,6 +6,5 @@ const spec = require('./openapi-v1.yaml'); | |||
const ui = SwaggerUI({ | |||
spec, | |||
dom_id: '#spec', | |||
supportedSubmitMethods: [] | |||
supportedSubmitMethods: ["get", "post"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much @PierreBesson for the contribution and adding the servers
option! 💯
However, currently the Try it out
feature in swagger UI of Sidecar is disabled due to a CORS issue :
- related sidecar comment and related PR
- error received when using the
Try it out
button (if enabled e.g. while connected in polkadot public sidecar)Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://polkadot-public-sidecar.parity-chains.parity.io/runtime/code. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.
- related resource : "Reason: CORS header 'Access-Control-Allow-Origin' missing"
So I am not sure if at this moment we would like to enable it again and tackle this CORS error.
cc @TarikGul
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Via Pierres comment above CORS headers have been added on the Server-side for https://paritytech.github.io/
so we should be totally fine!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad! I rushed to check the changes and missed the description!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes CORS has been dealt with.
Thanks so much for setting this up! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just the merge conflict needs to be resovled, but thanks so much again! LGTM
282d6d6
to
f1275c6
Compare
Add public sidecar URLs to swagger-ui to let people try out API requests. CORS headers have been set up on the server-side to allow requests from https://paritytech.github.io/ to be accepted.