question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not possible to try out openapi endpoints with auth and payload

See original GitHub issue

With fresh backstage when trying to try out any endpoint which is protected with auth and has payload (methods POST, DELETE, etc.) the UI stucks and there is an error in the console.

image image

Expected Behavior

It works, like it worked before

Current Behavior

It does not work

Possible Solution

🤷‍♂️, do not use fresh backstage, which uses fresh swagger-ui-react

Steps to Reproduce

  1. install fresh backstage using npx @backstage/create-app
  2. run it with yarn dev
  3. open http://localhost:3000/catalog/default/api/spotify/definition#/category-follow/endpoint-unfollow-artists-users and try to execute that

Context

This is major feature of the backstage itself, it stops us from keeping the backstage fresh. Currently we can not update dependencies.

Try out in swagger UI still works with endpoints where no auth is configures (petstore example).

It looks it is related to this issue and connected with some fresh update of swagger-ui-react: https://github.com/swagger-api/swagger-ui/issues/7797#issuecomment-1028835529 . Long ago there was also an issue in the React repo: https://github.com/facebook/react/issues/14484, seems that this is happening when there is some React versions mismatch.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
PavelPolyakovcommented, Feb 9, 2022

Ok, new input. When I add resolution like this:

  "resolutions": {
    "**/swagger-ui-react": "4.1.0"
  }

Then it seems to work. In the yarn.lock I then get:

swagger-ui-react@4.1.0, swagger-ui-react@^4.1.3:
  version "4.1.0"
  resolved "https://registry.yarnpkg.com/swagger-ui-react/-/swagger-ui-react-4.1.0.tgz#6033d40de813b5ac2f76392be77f8b2c9d734b15"
  integrity sha512-+25y5Hn39S6MjRbKLfdcwwe1xRdAMCNabHKDHc3LAQ0PE1xPT7aWY6KTQIOGOwsb36ev5ic5ZoUz0Wx6xeDfnQ==
  dependencies:
    "@babel/runtime-corejs3" "^7.14.7"
    "@braintree/sanitize-url" "^5.0.2"
    base64-js "^1.5.1"
    classnames "^2.3.1"
    css.escape "1.5.1"
    deep-extend "0.6.0"
    dompurify "=2.3.3"
    ieee754 "^1.2.1"
    immutable "^3.x.x"
    js-file-download "^0.4.12"
    js-yaml "=4.1.0"
    lodash "^4.17.21"
    memoizee "^0.4.15"
    prop-types "^15.7.2"
    randombytes "^2.1.0"
    react-copy-to-clipboard "5.0.3"
    react-debounce-input "=3.2.4"
    react-immutable-proptypes "2.2.0"
    react-immutable-pure-component "^2.2.0"
    react-inspector "^5.1.1"
    react-redux "^7.2.4"
    react-syntax-highlighter "^15.4.4"
    redux "^4.1.0"
    redux-immutable "^4.0.0"
    remarkable "^2.0.1"
    reselect "^4.0.0"
    serialize-error "^8.1.0"
    sha.js "^2.4.11"
    swagger-client "^3.17.0"
    url-parse "^1.5.3"
    xml "=1.0.1"
    xml-but-prettier "^1.0.1"
    zenscroll "^4.0.2"
0reactions
github-actions[bot]commented, Apr 10, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using OpenAPI and Swagger UI - Quarkus
This guide explains how your Quarkus application can expose its API description through an OpenAPI specification and how you can test it via...
Read more >
Step 6: The security object (OpenAPI tutorial)
To submit requests that are authorized by your API server, the spec must contain security information that will authorize the request.
Read more >
OpenAPI Specification - Version 3.0.3 - Swagger
The OpenAPI Specification defines a standard interface to RESTful APIs which allows both humans and computers to understand service capabilities without ...
Read more >
Endpoints Security with service account - Google Groups
I have a problem while trying to secure my end points with a ... when i try to hit the endpoint it say...
Read more >
OpenAPI Specification v3.1.0 | Introduction, Definitions, & More
Use of this property is NOT RECOMMENDED, as it is likely to be removed in a later revision. The rules for serialization of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found