Skip to content

Commit ddf6e1f

Browse files
committed
Merge branch 'swagger4.15'
2 parents 8e57833 + 6f1875e commit ddf6e1f

11 files changed

+73
-229
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
html {
2+
box-sizing: border-box;
3+
overflow: -moz-scrollbars-vertical;
4+
overflow-y: scroll;
5+
}
6+
7+
*,
8+
*:before,
9+
*:after {
10+
box-sizing: inherit;
11+
}
12+
13+
body {
14+
margin: 0;
15+
background: #fafafa;
16+
}

aiohttp_swagger/swagger_ui3/index.html

Lines changed: 21 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -4,57 +4,32 @@
44
<head>
55
<meta charset="UTF-8">
66
<title>Swagger UI</title>
7-
<link rel="stylesheet" type="text/css" href="##STATIC_PATH##/swagger-ui.css" >
7+
<link rel="stylesheet" type="text/css" href="##STATIC_PATH##/swagger-ui.css" />
8+
<link rel="stylesheet" type="text/css" href="##STATIC_PATH##/index.css" />
89
<link rel="icon" type="image/png" href="##STATIC_PATH##/favicon-32x32.png" sizes="32x32" />
910
<link rel="icon" type="image/png" href="##STATIC_PATH##/favicon-16x16.png" sizes="16x16" />
10-
<style>
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-
}
30-
</style>
3111
</head>
3212

3313
<body>
3414
<div id="swagger-ui"></div>
35-
36-
<script src="##STATIC_PATH##/swagger-ui-bundle.js"> </script>
37-
<script src="##STATIC_PATH##/swagger-ui-standalone-preset.js"> </script>
38-
<script>
39-
window.onload = function() {
40-
// Begin Swagger UI call region
41-
const ui = SwaggerUIBundle({
42-
url: "##SWAGGER_CONFIG##",
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>
15+
<script src="##STATIC_PATH##/swagger-ui-bundle.js" charset="UTF-8"> </script>
16+
<script src="##STATIC_PATH##/swagger-ui-standalone-preset.js" charset="UTF-8"> </script>
17+
<script charset="UTF-8">
18+
window.onload = function() {
19+
window.ui = SwaggerUIBundle({
20+
url: "##SWAGGER_CONFIG##",
21+
dom_id: '#swagger-ui',
22+
deepLinking: true,
23+
presets: [
24+
SwaggerUIBundle.presets.apis,
25+
SwaggerUIStandalonePreset
26+
],
27+
plugins: [
28+
SwaggerUIBundle.plugins.DownloadUrl
29+
],
30+
layout: "StandaloneLayout"
31+
});
32+
};
33+
</script>
5934
</body>
6035
</html>
Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<!doctype html>
22
<html lang="en-US">
3-
<title>Swagger UI: OAuth2 Redirect</title>
4-
<body onload="run()">
5-
</body>
6-
</html>
3+
<head>
4+
<title>Swagger UI: OAuth2 Redirect</title>
5+
</head>
6+
<body>
77
<script>
88
'use strict';
99
function run () {
@@ -13,31 +13,32 @@
1313
var isValid, qp, arr;
1414

1515
if (/code|token|error/.test(window.location.hash)) {
16-
qp = window.location.hash.substring(1);
16+
qp = window.location.hash.substring(1).replace('?', '&');
1717
} else {
1818
qp = location.search.substring(1);
1919
}
2020

21-
arr = qp.split("&")
22-
arr.forEach(function (v,i,_arr) { _arr[i] = '"' + v.replace('=', '":"') + '"';})
21+
arr = qp.split("&");
22+
arr.forEach(function (v,i,_arr) { _arr[i] = '"' + v.replace('=', '":"') + '"';});
2323
qp = qp ? JSON.parse('{' + arr.join() + '}',
2424
function (key, value) {
25-
return key === "" ? value : decodeURIComponent(value)
25+
return key === "" ? value : decodeURIComponent(value);
2626
}
27-
) : {}
27+
) : {};
2828

29-
isValid = qp.state === sentState
29+
isValid = qp.state === sentState;
3030

3131
if ((
32-
oauth2.auth.schema.get("flow") === "accessCode"||
33-
oauth2.auth.schema.get("flow") === "authorizationCode"
32+
oauth2.auth.schema.get("flow") === "accessCode" ||
33+
oauth2.auth.schema.get("flow") === "authorizationCode" ||
34+
oauth2.auth.schema.get("flow") === "authorization_code"
3435
) && !oauth2.auth.code) {
3536
if (!isValid) {
3637
oauth2.errCb({
3738
authId: oauth2.auth.name,
3839
source: "auth",
3940
level: "warning",
40-
message: "Authorization may be unsafe, passed state was changed in server Passed state wasn't returned from auth server"
41+
message: "Authorization may be unsafe, passed state was changed in server. The passed state wasn't returned from auth server."
4142
});
4243
}
4344

@@ -46,7 +47,7 @@
4647
oauth2.auth.code = qp.code;
4748
oauth2.callback({auth: oauth2.auth, redirectUrl: redirectUrl});
4849
} else {
49-
let oauthErrorMsg
50+
let oauthErrorMsg;
5051
if (qp.error) {
5152
oauthErrorMsg = "["+qp.error+"]: " +
5253
(qp.error_description ? qp.error_description+ ". " : "no accessCode received from the server. ") +
@@ -57,12 +58,22 @@
5758
authId: oauth2.auth.name,
5859
source: "auth",
5960
level: "error",
60-
message: oauthErrorMsg || "[Authorization failed]: no accessCode received from the server"
61+
message: oauthErrorMsg || "[Authorization failed]: no accessCode received from the server."
6162
});
6263
}
6364
} else {
6465
oauth2.callback({auth: oauth2.auth, token: qp, isValid: isValid, redirectUrl: redirectUrl});
6566
}
6667
window.close();
6768
}
69+
70+
if (document.readyState !== 'loading') {
71+
run();
72+
} else {
73+
document.addEventListener('DOMContentLoaded', function () {
74+
run();
75+
});
76+
}
6877
</script>
78+
</body>
79+
</html>

aiohttp_swagger/swagger_ui3/swagger-ui-bundle.js

Lines changed: 2 additions & 133 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

aiohttp_swagger/swagger_ui3/swagger-ui-bundle.js.map

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

aiohttp_swagger/swagger_ui3/swagger-ui-standalone-preset.js

Lines changed: 2 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

aiohttp_swagger/swagger_ui3/swagger-ui-standalone-preset.js.map

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

aiohttp_swagger/swagger_ui3/swagger-ui.css

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

aiohttp_swagger/swagger_ui3/swagger-ui.css.map

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

aiohttp_swagger/swagger_ui3/swagger-ui.js

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

0 commit comments

Comments
 (0)