swagger-api / swagger-api/swagger-ui
How can I add a custom layout for SwaggerUI
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 29k
- Forks
- 9.3k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 25
Description
I have installed Swagger-UI-dist and after this wanted to add custom layout. In the docs there is a script, that I was searching for, but it's not working. Tried to add script on swagger-initializer.js, but there was a problem with React import. After that I found some information about system object and system.React reference for using React, but I can't get this system object into swagger-initializer.js. I haven't work with React before and don't know6 what the problem is. Can someone help me and answer, what am I doing incorrect.
- OS: macOS
- Browser: safari
- Version: 22
- Method of installation: dist assets
- Swagger-UI version: 3.10.0
- Swagger/OpenAPI version: OpenAPI 3.1
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
Start with the Swagger-UI dist assets and the referenced swagger-initializer.js script, then review how the documented custom-layout example uses the system object and React reference. Reproduce the React import problem in the reported Swagger-UI 3.10.0 setup. Done means a custom layout loads successfully without the initializer error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100