Steps to follow:
- Create a new global SwaggerUi object, make sure to give the global variable a new name (in this case,
swaggerUi2
- https://gist.github.com/webron/7c41db7f777471fcbc10#file-index-html-L59-L84. - Assign a new URL - https://gist.github.com/webron/7c41db7f777471fcbc10#file-index-html-L60 - in this case, we use the same pet store URL, but just change the value to the swagger.json you want to display.
- Provide a unique
dom_id
- in this case we went withswagger-ui-container2
- https://gist.github.com/webron/7c41db7f777471fcbc10#file-index-html-L61 - Load the new SwaggerUi object - https://gist.github.com/webron/7c41db7f777471fcbc10#file-index-html-L103
- Add a
<div>
to display it. In it, make sure theid
is set to thedom_id
set in step 3, and that theclass
isswagger-ui-wrap
so that the CSS is applied - https://gist.github.com/webron/7c41db7f777471fcbc10#file-index-html-L135
You can repeat the steps above as many times as needed, just make sure to provide a unique `dom_i