Last active
November 29, 2019 04:59
-
-
Save buzztaiki/e243ccc3203f96777e2e8141d4993664 to your computer and use it in GitHub Desktop.
Swagger UI
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
<!-- HTML for static distribution bundle build --> | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Swagger UI</title> | |
<link rel="stylesheet" type="text/css" href="https://unpkg.com/swagger-ui-dist@3/swagger-ui.css" > | |
<style> | |
html | |
{ | |
box-sizing: border-box; | |
overflow: -moz-scrollbars-vertical; | |
overflow-y: scroll; | |
} | |
*, | |
*:before, | |
*:after | |
{ | |
box-sizing: inherit; | |
} | |
body | |
{ | |
margin:0; | |
background: #fafafa; | |
} | |
</style> | |
</head> | |
<body> | |
<div id="swagger-ui"></div> | |
<script src="https://unpkg.com/swagger-ui-dist@3/swagger-ui-bundle.js"> </script> | |
<script src="https://unpkg.com/swagger-ui-dist@3/swagger-ui-standalone-preset.js"> </script> | |
<script> | |
window.onload = function() { | |
// Build a system | |
const ui = SwaggerUIBundle({ | |
url: "swagger.yml", | |
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
https://github.com/swagger-api/swagger-ui/blob/master/dist/index.html を cdn を使うように変えて、spec への参照も変えたもの。