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

docs: Add server urls to swagger-ui #1330

Merged
merged 1 commit into from
Sep 11, 2023
Merged

Conversation

PierreBesson
Copy link
Contributor

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.

@PierreBesson PierreBesson requested a review from a team as a code owner September 11, 2023 09:53
@@ -6,6 +6,5 @@ const spec = require('./openapi-v1.yaml');
const ui = SwaggerUI({
spec,
dom_id: '#spec',
supportedSubmitMethods: []
supportedSubmitMethods: ["get", "post"]
Copy link
Contributor

@Imod7 Imod7 Sep 11, 2023

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

Copy link
Member

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!

Copy link
Contributor

@Imod7 Imod7 Sep 11, 2023

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!

Copy link
Contributor Author

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.

@TarikGul
Copy link
Member

CORS headers have been set up on the server-side to allow requests from https://paritytech.github.io/ to be accepted.

Thanks so much for setting this up!

@TarikGul TarikGul changed the title Add server urls to swagger-ui docs: Add server urls to swagger-ui Sep 11, 2023
Copy link
Member

@TarikGul TarikGul left a 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

@PierreBesson PierreBesson merged commit 05f3966 into master Sep 11, 2023
14 checks passed
@PierreBesson PierreBesson deleted the pib-swagger-ui-server-urls branch September 11, 2023 13:19
This pull request was closed.
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 this pull request may close these issues.

3 participants