rswag-ui 2.10.1 → 2.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/generators/rswag/ui/install/templates/rswag_ui.rb +1 -1
- data/lib/rswag/ui/configuration.rb +5 -0
- data/lib/rswag/ui/middleware.rb +2 -2
- data/lib/rswag/ui.rb +4 -0
- 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 +8 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3974cf8486beb436cdf6c45c2f08773e02485f932b5697fe0e859e19d4166e39
|
4
|
+
data.tar.gz: 24fdef3744a7dde26ce81c702d581257b4cec64bdf9aeb244726665b16b1f7e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5dc7072ef0ef2ccf84adf796db1a5ba251ad5ed3830898d4c8d028ed0ec3653b33bc0c2d743477b719412dca065614315daacf2b84d980fc52eabe1193fc0ec9
|
7
|
+
data.tar.gz: 479f7d983edbe0ded205c07691b885b21b0ae711d20b314006cccbd4eb19d32ac3b45459a42f38a28e6d2847a81954bb546b46e3ca799e303cb3ea9e17d6a740
|
@@ -5,7 +5,7 @@ Rswag::Ui.configure do |c|
|
|
5
5
|
# host) to the corresponding endpoint and the second is a title that will be
|
6
6
|
# displayed in the document selector.
|
7
7
|
# NOTE: If you're using rspec-api to expose Swagger files
|
8
|
-
# (under
|
8
|
+
# (under openapi_root) as JSON or YAML endpoints, then the list below should
|
9
9
|
# correspond to the relative paths for those endpoints.
|
10
10
|
|
11
11
|
c.swagger_endpoint '/api-docs/v1/swagger.yaml', 'API V1 Docs'
|
@@ -26,6 +26,11 @@ module Rswag
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def swagger_endpoint(url, name)
|
29
|
+
Rswag::Ui.deprecator.warn('Rswag::Ui: WARNING: The method will be renamed to "openapi_endpoint" in v3.0')
|
30
|
+
openapi_endpoint(url, name)
|
31
|
+
end
|
32
|
+
|
33
|
+
def openapi_endpoint(url, name)
|
29
34
|
@config_object[:urls] ||= []
|
30
35
|
@config_object[:urls] << { url: url, name: name }
|
31
36
|
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';
|
data/lib/rswag/ui.rb
CHANGED
@@ -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
|
+
};
|