Skip to content

Commit d7b4933

Browse files
committed
Cleaned up the template files
I removed the window.onload and moved the scipt tags to be within the body of the page. I also updated the version numbers to reflect more recent changes to flask-apispec
1 parent 99c4a91 commit d7b4933

File tree

3 files changed

+17
-19
lines changed

3 files changed

+17
-19
lines changed

flask_apispec/templates/swagger-ui.html

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,24 @@
1111
<body class="swagger-section">
1212
<div id="message-bar" class="swagger-ui-wrap" data-sw-translate>&nbsp;</div>
1313
<div id="swagger-ui-container" class="swagger-ui-wrap"></div>
14-
</body>
15-
1614
<script src="{{ url_for('flask-apispec.static', filename='swagger-ui-bundle.js') }}" type="text/javascript"></script>
1715
<script src="{{ url_for('flask-apispec.static', filename='swagger-ui-standalone-preset.js') }}" type="text/javascript"></script>
18-
<script>
19-
window.onload = function() {
20-
const ui = SwaggerUIBundle({
21-
url: "{{ url_for('flask-apispec.swagger-json') }}",
22-
dom_id: '#swagger-ui-container',
23-
deepLinking: true,
24-
presets: [
25-
SwaggerUIBundle.presets.apis,
26-
SwaggerUIStandalonePreset
27-
],
28-
plugins: [
29-
SwaggerUIBundle.plugins.DownloadUrl
30-
],
31-
layout: "BaseLayout"
16+
<script type="text/javascript">
17+
var ui = SwaggerUIBundle({
18+
url: "{{ url_for('flask-apispec.swagger-json') }}",
19+
dom_id: '#swagger-ui-container',
20+
deepLinking: true,
21+
presets: [
22+
SwaggerUIBundle.presets.apis,
23+
SwaggerUIStandalonePreset
24+
],
25+
plugins: [
26+
SwaggerUIBundle.plugins.DownloadUrl
27+
],
28+
layout: "BaseLayout"
3229
})
3330
window.ui = ui
34-
}
3531
</script>
32+
</body>
33+
3634
</html>

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "flask-apispec",
3-
"version": "0.4.2",
3+
"version": "0.6.0",
44
"dependencies": {
55
"swagger-ui-dist": "3.9.3"
66
},

0 commit comments

Comments
 (0)