swagger-api / swagger-api/swagger-ui
When I use @SecurityScheme, the UI shows 'Could not render n, see the console.'
Open
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 29k
- Forks
- 9.3k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 25
Description
Describe the bug
- Add spring security oauth2 dependency, and ignore urls '/swagger-ui/','/v3/api-docs/'.
- Add the Controller annotation
@SecurityScheme(name = "登录", type = SecuritySchemeType.OAUTH2, scheme = "bearer") - The console does not show any exception. The UI show below


TypeError: Cannot read property 'entrySeq' of undefined
at wrap-selectors.js:40
at immutable.js:2867
at immutable.js:3016
at immutable.js:2832
at immutable.js:2699
at St.__iterate (immutable.js:2206)
at qt.__iterate (immutable.js:2698)
at Jt.__iterate (immutable.js:2830)
at r.Qt.r.__iterateUncached (immutable.js:3015)
at pe (immutable.js:604)
TypeError: Cannot read property 'entrySeq' of undefined
at wrap-selectors.js:40
at immutable.js:2867
at immutable.js:3016
at immutable.js:2832
at immutable.js:2699
at St.__iterate (immutable.js:2206)
at qt.__iterate (immutable.js:2698)
at Jt.__iterate (immutable.js:2830)
at r.Qt.r.__iterateUncached (immutable.js:3015)
at pe (immutable.js:604) {componentStack: "↵ at n (http://localhost:8080/swagger-ui/swagge…st:8080/swagger-ui/swagger-ui-bundle.js:2:237333)"}
- If remove @SecurityScheme, the 'Could not render n, see the console. ' not show.
To Reproduce
Steps to reproduce the behavior:
- What modules and versions are you using?
- spring boot:2.3.12.RELEASE
- spring-cloud-starter-oauth2:2.2.5.RELEASE
- springdoc-openapi-ui:1.6.8
- springdoc-openapi-security:1.6.8
- swagger-ui:4.10.3
- swagger-code:2.2.0
- JDK:1.8
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure with springdoc-openapi-ui 1.6.8, springdoc-openapi-security 1.6.8, Swagger UI 4.10.3, and the shown @SecurityScheme annotation. Start at wrap-selectors.js using the reported entrySeq stack trace; done means the SecurityScheme renders in the UI without the console error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, spring-boot
- Domain
- authentication, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100