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.

3.25.1 - 3.25.3 swagger-ui-react docExpansion=list throws a TypeError

See original GitHub issue

Using "swagger-ui-react": "3.25.1"

If I specify docExpansion=list,

 <SwaggerUI docExpansion="list" url={specUrl}  />

It will throw the following error

Uncaught TypeError: Cannot read property 'indexOf' of undefined
    at value (swagger-ui.js:8)
    at swagger-ui.js:1

Without docExpansion, it works

 <SwaggerUI url={specUrl}  />

With "swagger-ui-react": "3.25.0", docExpansion works

 <SwaggerUI docExpansion="list" url={specUrl}  />

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:7
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
lordkadacommented, May 28, 2020

In the meanwhile, I have just added the supportedSubmitMethods property (e.g. set to supportedSubmitMethods={[“get”, “put”, “post”, “delete”]}) and it works (version 3.25.4).

1reaction
bwright1558commented, May 22, 2020

Found the problem. The latest change to swagger-ui-react added support for the supportedSubmitMethods prop. But if you don’t set this value, then it gets passed to swagger-ui as null, which obviously doesn’t have an indexOf property. I’m working on a fix and will have a PR for this shortly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

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