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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d1499c87cda3463347c079d53c7e3f2b957bb2a07ab0df3ab56cdc6b920ba5a9
4
- data.tar.gz: 55876b9fa70c60a5f305b4dcafbebe6736ac69388179e6c3df8ece60f43bf4a3
3
+ metadata.gz: 4a053278f533d619e1513d32dc3e38e943dd24c9ad38fddc4214cf1b5ebb8880
4
+ data.tar.gz: 57fd479e32c5cef6ff17f052614b3408d305ca1e8a56eb6980ab870460f35457
5
5
  SHA512:
6
- metadata.gz: 4abe4ed324e524f1932ae4666113d2b61d88eb7d35b2b2fcdc455ce66573832e286f9d8dbe770e71d681b69766a48f93679bb58d3315b2a8b584453dbac33892
7
- data.tar.gz: 3378edd049676eb6cd9285a9643f9b27a286daf5813fbbc25ea65d5bd370631dee5cd994e9eef7864c5eeee914b540ea332472c55bc5030b064430f3871b4407
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
@@ -41,9 +41,9 @@ module Rswag
41
41
  end
42
42
 
43
43
  def csp
44
- <<~POLICY.gsub "\n", ' '
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';
@@ -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
+ }
@@ -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 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."
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
- window.addEventListener('DOMContentLoaded', function () {
71
- run();
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>
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "swagger-ui-dist",
3
- "version": "4.1.3",
3
+ "version": "5.9.4",
4
4
  "main": "index.js",
5
5
  "repository": "git@github.com:swagger-api/swagger-ui.git",
6
6
  "contributors": [
@@ -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
+ };