3.25.1 - 3.25.3 swagger-ui-react docExpansion=list throws a TypeError
See original GitHub issueUsing "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:
- Created 3 years ago
- Reactions:7
- Comments:14 (6 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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).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 anindexOf
property. I’m working on a fix and will have a PR for this shortly.