Skip to content

Instantly share code, notes, and snippets.

@moriya-hm5
Created December 19, 2019 12:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moriya-hm5/fba79ea1b37b56d0170a8bf84c7f25ff to your computer and use it in GitHub Desktop.
Save moriya-hm5/fba79ea1b37b56d0170a8bf84c7f25ff to your computer and use it in GitHub Desktop.
<body>
<div id="swagger-ui"></div>
<script src="./swagger-ui-bundle.js"> </script>
<script src="./swagger-ui-standalone-preset.js"> </script>
<script src="./sample-dev-oas30-apigateway.js"> </script> <!-- jsonファイルをjsに変えて追加 -->
<script>
window.onload = function() {
// Build a system
const ui = SwaggerUIBundle({
spec: spec, <!-- specプロパティにspecという変数を指定 -->
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl
],
layout: "StandaloneLayout"
})
window.ui = ui
}
</script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment