rswag-ui 2.11.0 → 2.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rswag/ui/configuration.rb +1 -0
- data/lib/rswag/ui/middleware.rb +2 -2
- data/node_modules/swagger-ui-dist/index.css +16 -0
- data/node_modules/swagger-ui-dist/index.html +2 -43
- data/node_modules/swagger-ui-dist/oauth2-redirect.html +10 -6
- data/node_modules/swagger-ui-dist/package.json +1 -1
- data/node_modules/swagger-ui-dist/swagger-initializer.js +20 -0
- data/node_modules/swagger-ui-dist/swagger-ui-bundle.js +1 -1
- data/node_modules/swagger-ui-dist/swagger-ui-bundle.js.map +1 -1
- data/node_modules/swagger-ui-dist/swagger-ui-es-bundle-core.js +1 -1
- data/node_modules/swagger-ui-dist/swagger-ui-es-bundle-core.js.map +1 -1
- data/node_modules/swagger-ui-dist/swagger-ui-es-bundle.js +1 -1
- data/node_modules/swagger-ui-dist/swagger-ui-es-bundle.js.map +1 -1
- data/node_modules/swagger-ui-dist/swagger-ui-standalone-preset.js +1 -1
- data/node_modules/swagger-ui-dist/swagger-ui-standalone-preset.js.map +1 -1
- data/node_modules/swagger-ui-dist/swagger-ui.css +1 -2
- data/node_modules/swagger-ui-dist/swagger-ui.css.map +1 -1
- data/node_modules/swagger-ui-dist/swagger-ui.js +1 -2
- data/node_modules/swagger-ui-dist/swagger-ui.js.map +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a053278f533d619e1513d32dc3e38e943dd24c9ad38fddc4214cf1b5ebb8880
|
4
|
+
data.tar.gz: 57fd479e32c5cef6ff17f052614b3408d305ca1e8a56eb6980ab870460f35457
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56c555dde03031cf0cb2ed1c59464195788be1a730971f1163501f8b341842573030d8ae7548590028145acc4077601b3544732e42a45fd7c539ab4698dc7382
|
7
|
+
data.tar.gz: 51fb270be2c9df31cd52f1cfe914918c88b57c71aea83b096ea11a828003f812c3c99580fcd170954af10d513d8c470bf2859f64d27889c76a46d04befafe05b
|
@@ -26,6 +26,7 @@ module Rswag
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def swagger_endpoint(url, name)
|
29
|
+
ActiveSupport::Deprecation.warn('Rswag::Ui: WARNING: The method will be renamed to "openapi_endpoint" in v3.0')
|
29
30
|
@config_object[:urls] ||= []
|
30
31
|
@config_object[:urls] << { url: url, name: name }
|
31
32
|
end
|
data/lib/rswag/ui/middleware.rb
CHANGED
@@ -41,9 +41,9 @@ module Rswag
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def csp
|
44
|
-
<<~POLICY.
|
44
|
+
<<~POLICY.tr "\n", ' '
|
45
45
|
default-src 'self';
|
46
|
-
img-src 'self' data
|
46
|
+
img-src 'self' data: https://validator.swagger.io;
|
47
47
|
font-src 'self' https://fonts.gstatic.com;
|
48
48
|
style-src 'self' 'unsafe-inline' https://fonts.googleapis.com;
|
49
49
|
script-src 'self' 'unsafe-inline';
|
@@ -5,56 +5,15 @@
|
|
5
5
|
<meta charset="UTF-8">
|
6
6
|
<title>Swagger UI</title>
|
7
7
|
<link rel="stylesheet" type="text/css" href="./swagger-ui.css" />
|
8
|
+
<link rel="stylesheet" type="text/css" href="index.css" />
|
8
9
|
<link rel="icon" type="image/png" href="./favicon-32x32.png" sizes="32x32" />
|
9
10
|
<link rel="icon" type="image/png" href="./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>
|
31
11
|
</head>
|
32
12
|
|
33
13
|
<body>
|
34
14
|
<div id="swagger-ui"></div>
|
35
|
-
|
36
15
|
<script src="./swagger-ui-bundle.js" charset="UTF-8"> </script>
|
37
16
|
<script src="./swagger-ui-standalone-preset.js" charset="UTF-8"> </script>
|
38
|
-
<script>
|
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>
|
17
|
+
<script src="./swagger-initializer.js" charset="UTF-8"> </script>
|
59
18
|
</body>
|
60
19
|
</html>
|
@@ -13,7 +13,7 @@
|
|
13
13
|
var isValid, qp, arr;
|
14
14
|
|
15
15
|
if (/code|token|error/.test(window.location.hash)) {
|
16
|
-
qp = window.location.hash.substring(1);
|
16
|
+
qp = window.location.hash.substring(1).replace('?', '&');
|
17
17
|
} else {
|
18
18
|
qp = location.search.substring(1);
|
19
19
|
}
|
@@ -38,7 +38,7 @@
|
|
38
38
|
authId: oauth2.auth.name,
|
39
39
|
source: "auth",
|
40
40
|
level: "warning",
|
41
|
-
message: "Authorization may be unsafe, passed state was changed in server
|
41
|
+
message: "Authorization may be unsafe, passed state was changed in server. The passed state wasn't returned from auth server."
|
42
42
|
});
|
43
43
|
}
|
44
44
|
|
@@ -58,7 +58,7 @@
|
|
58
58
|
authId: oauth2.auth.name,
|
59
59
|
source: "auth",
|
60
60
|
level: "error",
|
61
|
-
message: oauthErrorMsg || "[Authorization failed]: no accessCode received from the server"
|
61
|
+
message: oauthErrorMsg || "[Authorization failed]: no accessCode received from the server."
|
62
62
|
});
|
63
63
|
}
|
64
64
|
} else {
|
@@ -67,9 +67,13 @@
|
|
67
67
|
window.close();
|
68
68
|
}
|
69
69
|
|
70
|
-
|
71
|
-
|
72
|
-
}
|
70
|
+
if (document.readyState !== 'loading') {
|
71
|
+
run();
|
72
|
+
} else {
|
73
|
+
document.addEventListener('DOMContentLoaded', function () {
|
74
|
+
run();
|
75
|
+
});
|
76
|
+
}
|
73
77
|
</script>
|
74
78
|
</body>
|
75
79
|
</html>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
window.onload = function() {
|
2
|
+
//<editor-fold desc="Changeable Configuration Block">
|
3
|
+
|
4
|
+
// the following lines will be replaced by docker/configurator, when it runs in a docker-container
|
5
|
+
window.ui = SwaggerUIBundle({
|
6
|
+
url: "https://petstore.swagger.io/v2/swagger.json",
|
7
|
+
dom_id: '#swagger-ui',
|
8
|
+
deepLinking: true,
|
9
|
+
presets: [
|
10
|
+
SwaggerUIBundle.presets.apis,
|
11
|
+
SwaggerUIStandalonePreset
|
12
|
+
],
|
13
|
+
plugins: [
|
14
|
+
SwaggerUIBundle.plugins.DownloadUrl
|
15
|
+
],
|
16
|
+
layout: "StandaloneLayout"
|
17
|
+
});
|
18
|
+
|
19
|
+
//</editor-fold>
|
20
|
+
};
|