update OpenAPI HTML rendering (#195)

This commit is contained in:
Tom Kralidis
2019-06-22 11:29:09 -04:00
committed by GitHub
parent c83a1c2ea0
commit 047db51da4
+52 -18
View File
@@ -1,23 +1,57 @@
<!doctype html>
<html>
<head>
<title>{{ config['metadata']['identification']['title'] }} OpenAPI Document</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swagger-ui-dist@3.22.2/swagger-ui.css">
<script src="https://unpkg.com/swagger-ui-dist@3.22.2/swagger-ui-bundle.js"></script>
<script>
function render() {
var ui = SwaggerUIBundle({
url: '{{ data['openapi-document-path'] }}',
dom_id: '#swagger-ui',
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIBundle.SwaggerUIStandalonePreset
]
});
<!-- HTML for static distribution bundle build -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Swagger UI - {{ config['metadata']['identification']['title'] }}</title>
<link rel="stylesheet" type="text/css" href="https://unpkg.com/swagger-ui-dist@3.22.2/swagger-ui.css" >
<link rel="icon" type="image/png" href="https://unpkg.com/swagger-ui-dist@3.22.2/favicon-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="https://unpkg.com/swagger-ui-dist@3.22.2/favicon-16x16.png" sizes="16x16" />
<style>
html
{
box-sizing: border-box;
overflow: -moz-scrollbars-vertical;
overflow-y: scroll;
}
</script>
*,
*:before,
*:after
{
box-sizing: inherit;
}
body
{
margin:0;
background: #fafafa;
}
</style>
</head>
<body onload="render()">
<body>
<div id="swagger-ui"></div>
<script src="https://unpkg.com/swagger-ui-dist@3.22.2/swagger-ui-bundle.js"> </script>
<script src="https://unpkg.com/swagger-ui-dist@3.22.2/swagger-ui-standalone-preset.js"> </script>
<script>
window.onload = function() {
// Begin Swagger UI call region
ui = SwaggerUIBundle({
url: '{{ data['openapi-document-path'] }}',
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl
],
layout: 'StandaloneLayout'
})
// End Swagger UI call region
window.ui = ui
}
</script>
<style>.swagger-ui .topbar .download-url-wrapper { display: none } undefined</style>
</body>
</html>