-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathswagger-initializer.js
More file actions
35 lines (33 loc) · 1.13 KB
/
swagger-initializer.js
File metadata and controls
35 lines (33 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
window.onload = function() {
window.ui = SwaggerUIBundle({
url: "./openapi.yaml",
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl,
// Rewrite servers to the go through the proxy.
// See: https://stackoverflow.com/a/68296752
function() {
return {
statePlugins: {
spec: {
wrapActions: {
updateJsonSpec: function(oriAction, system) {
return (spec) => {
spec.servers = [{url: window.location.origin+"/api"} ]
return oriAction(spec)
}
}
}
}
}
}
}
],
layout: "StandaloneLayout"
});
};