Created
April 24, 2020 20:47
-
-
Save ano/6aa608f2007a3192bc928c14740cfaa6 to your computer and use it in GitHub Desktop.
One Page Swagger / OpenAPI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>ServiceDesk Service Swagger</title> | |
<link rel="stylesheet" type="text/css" href="https://unpkg.com/[email protected]/swagger-ui.css"> | |
</head> | |
<body> | |
<div id="swagger-ui"></div> | |
<script src="https://unpkg.com/[email protected]/swagger-ui-standalone-preset.js"></script> | |
<script src="https://unpkg.com/[email protected]/swagger-ui-bundle.js"></script> | |
<script> | |
window.onload = function() { | |
// Build a system | |
const ui = SwaggerUIBundle({ | |
url: "<enter url to swagger.json here>", | |
dom_id: '#swagger-ui', | |
deepLinking: true, | |
presets: [ | |
SwaggerUIBundle.presets.apis, | |
SwaggerUIStandalonePreset | |
], | |
plugins: [ | |
SwaggerUIBundle.plugins.DownloadUrl | |
], | |
layout: "StandaloneLayout", | |
}) | |
window.ui = ui | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you, mate!
In my case, I used
specs
instead of URL. if anyone has the JSON but not the URL: