Skip to content

Commit 5ccb27f

Browse files
update swagger
1 parent 675d1ee commit 5ccb27f

10 files changed

+64
-150
lines changed

Diff for: favicon-16x16.png

-73 Bytes
Loading

Diff for: favicon-32x32.png

-1015 Bytes
Loading

Diff for: index.html

+47-133
Original file line numberDiff line numberDiff line change
@@ -1,146 +1,60 @@
1-
<!-- HTML for static distribution bundle build -->
1+
<!-- HTML for static distribution bundle build -->
22
<!DOCTYPE html>
33
<html lang="en">
4-
<head>
4+
<head>
55
<meta charset="UTF-8">
66
<title>Swagger UI</title>
7-
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,700|Source+Code+Pro:300,600,700|Titillium+Web:400,600,700" rel="stylesheet">
8-
9-
<link rel="stylesheet" type="text/css" href="./swagger-ui.css">
10-
<link rel="stylesheet" type="text/css" href="./emby-custom.css">
7+
<link rel="stylesheet" type="text/css" href="./swagger-ui.css" >
118
<link rel="icon" type="image/png" href="./favicon-32x32.png" sizes="32x32" />
129
<link rel="icon" type="image/png" href="./favicon-16x16.png" sizes="16x16" />
1310
<style>
14-
html {
15-
box-sizing: border-box;
16-
overflow: -moz-scrollbars-vertical;
17-
overflow-y: scroll;
18-
}
19-
20-
*,
21-
*:before,
22-
*:after {
23-
box-sizing: inherit;
24-
}
25-
26-
body {
27-
margin: 0;
28-
background: #fafafa;
29-
}
11+
html
12+
{
13+
box-sizing: border-box;
14+
overflow: -moz-scrollbars-vertical;
15+
overflow-y: scroll;
16+
}
17+
18+
*,
19+
*:before,
20+
*:after
21+
{
22+
box-sizing: inherit;
23+
}
24+
25+
body
26+
{
27+
margin:0;
28+
background: #fafafa;
29+
}
3030
</style>
31-
</head>
31+
</head>
3232

33-
<body>
33+
<body>
3434
<div id="swagger-ui"></div>
3535

36-
<script src="./swagger-ui-bundle.js"></script>
37-
<script src="./swagger-ui-standalone-preset.js"></script>
38-
<script src="./emby-custom.js"></script>
39-
<script src="./emby-auth.js"></script>
40-
36+
<script src="./swagger-ui-bundle.js"> </script>
37+
<script src="./swagger-ui-standalone-preset.js"> </script>
4138
<script>
42-
window.onload = function() {
43-
44-
function getWindowLocationSearch(win) {
45-
'use strict';
46-
47-
var search = (win || window).location.search;
48-
49-
if (!search) {
50-
51-
var index = window.location.href.indexOf('?');
52-
if (index !== -1) {
53-
search = window.location.href.substring(index);
54-
}
55-
}
56-
57-
return search || '';
58-
}
59-
60-
function getParameterByName(name, url) {
61-
'use strict';
62-
63-
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
64-
var regexS = "[\\?&]" + name + "=([^&#]*)";
65-
var regex = new RegExp(regexS, "i");
66-
67-
var results = regex.exec(url || getWindowLocationSearch());
68-
if (results == null)
69-
return "";
70-
else
71-
return decodeURIComponent(results[1].replace(/\+/g, " "));
72-
}
73-
74-
function preauthorizeApiKey(system, key, value) {
75-
const {
76-
authActions: { authorize },
77-
specSelectors: { specJson, isOAS3 }
78-
} = system;
79-
80-
const definitionBase = isOAS3() ? ["components", "securitySchemes"] : ["securityDefinitions"];
81-
82-
const schema = specJson().getIn([...definitionBase, key]);
83-
84-
if(!schema) {
85-
return null;
86-
}
87-
88-
return authorize({
89-
[key]: {
90-
value,
91-
schema: schema.toJS()
92-
}
93-
});
94-
}
95-
96-
var apikey = getParameterByName('api_key');
97-
98-
// Create Configuration
99-
const config = {
100-
url: getParameterByName('url') || "http://localhost:8096/openapi",
101-
dom_id: '#swagger-ui',
102-
deepLinking: true,
103-
defaultModelRendering: 'model',
104-
docExpansion: 'none',
105-
tagsSorter: 'alpha',
106-
showExtensions: false,
107-
filter: true,
108-
presets: [
109-
SwaggerUIBundle.presets.apis,
110-
SwaggerUIStandalonePreset
111-
],
112-
plugins: [
113-
SwaggerUIBundle.plugins.DownloadUrl,
114-
caseInsensitivePhraseFilter,
115-
renderPrimitive,
116-
renderEnum,
117-
renderArray,
118-
renderHttpAuth,
119-
renderAuths
120-
],
121-
layout: 'StandaloneLayout',
122-
onComplete: function() {
123-
if (apikey && apikey.trim() !== '') {
124-
preauthorizeApiKey(ui, 'apikeyauth', apikey);
125-
}
126-
}
127-
}
128-
129-
if (getParameterByName('staticview')) {
130-
131-
config.plugins = [
132-
caseInsensitivePhraseFilter, disableAuthorizePlugin, hideTopbarPlugin,
133-
renderPrimitive, renderEnum, renderArray
134-
];
135-
config.url = 'openapi.json';
136-
config.supportedSubmitMethods = [];
137-
apikey = null;
138-
}
139-
140-
// Build a system
141-
const ui = SwaggerUIBundle(config);
142-
window.ui = ui;
143-
}
144-
</script>
145-
</body>
39+
window.onload = function() {
40+
// Begin Swagger UI call region
41+
const ui = SwaggerUIBundle({
42+
url: "https://petstore.swagger.io/v2/swagger.json",
43+
dom_id: '#swagger-ui',
44+
deepLinking: true,
45+
presets: [
46+
SwaggerUIBundle.presets.apis,
47+
SwaggerUIStandalonePreset
48+
],
49+
plugins: [
50+
SwaggerUIBundle.plugins.DownloadUrl
51+
],
52+
layout: "StandaloneLayout"
53+
})
54+
// End Swagger UI call region
55+
56+
window.ui = ui
57+
}
58+
</script>
59+
</body>
14660
</html>

Diff for: swagger-ui-bundle.js

+10-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: swagger-ui-bundle.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: swagger-ui-standalone-preset.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: swagger-ui-standalone-preset.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: swagger-ui.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: swagger-ui.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: swagger-ui.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)