Skip to content

Commit 2890958

Browse files
committed
Update docs
1 parent 4200e6b commit 2890958

30 files changed

+553
-147
lines changed

demo-mkdocs/docs/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ A MkDocs plugin supports for add [Swagger UI](https://github.com/swagger-api/swa
1616
1. Python Package
1717
1. beautifulsoup4>=4.11.1
1818
2. [Swagger UI dist](https://www.npmjs.com/package/swagger-ui-dist) javascript file and css file
19-
1. swagger-ui-dist>=4.13.0
19+
1. swagger-ui-dist==4.13.2
2020

2121
## Usage
2222

@@ -55,7 +55,7 @@ A MkDocs plugin supports for add [Swagger UI](https://github.com/swagger-api/swa
5555
| filter | String or Boolean | Default: False. If set, enables filtering. The top bar will show an edit box that you can use to filter the tagged operations that are shown. Can be Boolean to enable or disable, or a string, in which case filtering will be enabled using that string as the filter expression. Filtering is case sensitive matching the filter expression anywhere inside the tag. |
5656
| syntaxHighlightTheme | String | Default: "agate". [Highlight.js](https://highlightjs.org/static/demo/) syntax coloring theme to use. It can be "agate", "arta", "monokai", "nord", "obsidian" or "tomorrow-night" |
5757
| tryItOutEnabled | Boolean | Default: False. Controls whether the "Try it out" section should be enabled by default. |
58-
| oauth2RedirectUrl | String | Default: None. OAuth redirect URL. |
58+
| oauth2RedirectUrl | String | Default: [site url]/assets/swagger-ui/oauth2-redirect.html. OAuth redirect URL. |
5959
| supportedSubmitMethods | Array | Default: All Http Methods. Array=["get", "put", "post", "delete", "options", "head", "patch", "trace"]. List of HTTP methods that have the "Try it out" feature enabled. An empty array disables "Try it out" for all operations. This does not filter the operations from the display. |
6060
| validatorUrl | String | Default: "https://validator.swagger.io/validator". By default, Swagger UI attempts to validate specs against swagger.io's online validator in multiple OAS Swagger UI. You can use this parameter to set a different validator URL, for example for locally deployed validators ([Validator Badge](https://github.com/swagger-api/validator-badge)). Setting it "none" to disable validation. |
6161

docs/404.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@
8888

8989

9090

91+
92+
9193
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
9294
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
9395
<label class="md-overlay" for="__drawer"></label>

docs/assets/javascripts/swagger-ui-bundle.js

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

docs/assets/javascripts/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.

docs/assets/javascripts/swagger-ui-standalone-preset.js

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

docs/assets/javascripts/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.

docs/assets/stylesheets/swagger-ui.css

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

docs/assets/stylesheets/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.
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<!doctype html>
2+
<html lang="en-US">
3+
<head>
4+
<title>Swagger UI: OAuth2 Redirect</title>
5+
</head>
6+
<body>
7+
<script>
8+
'use strict';
9+
function run () {
10+
var oauth2 = window.opener.swaggerUIRedirectOauth2;
11+
var sentState = oauth2.state;
12+
var redirectUrl = oauth2.redirectUrl;
13+
var isValid, qp, arr;
14+
15+
if (/code|token|error/.test(window.location.hash)) {
16+
qp = window.location.hash.substring(1);
17+
} else {
18+
qp = location.search.substring(1);
19+
}
20+
21+
arr = qp.split("&");
22+
arr.forEach(function (v,i,_arr) { _arr[i] = '"' + v.replace('=', '":"') + '"';});
23+
qp = qp ? JSON.parse('{' + arr.join() + '}',
24+
function (key, value) {
25+
return key === "" ? value : decodeURIComponent(value);
26+
}
27+
) : {};
28+
29+
isValid = qp.state === sentState;
30+
31+
if ((
32+
oauth2.auth.schema.get("flow") === "accessCode" ||
33+
oauth2.auth.schema.get("flow") === "authorizationCode" ||
34+
oauth2.auth.schema.get("flow") === "authorization_code"
35+
) && !oauth2.auth.code) {
36+
if (!isValid) {
37+
oauth2.errCb({
38+
authId: oauth2.auth.name,
39+
source: "auth",
40+
level: "warning",
41+
message: "Authorization may be unsafe, passed state was changed in server. The passed state wasn't returned from auth server."
42+
});
43+
}
44+
45+
if (qp.code) {
46+
delete oauth2.state;
47+
oauth2.auth.code = qp.code;
48+
oauth2.callback({auth: oauth2.auth, redirectUrl: redirectUrl});
49+
} else {
50+
let oauthErrorMsg;
51+
if (qp.error) {
52+
oauthErrorMsg = "["+qp.error+"]: " +
53+
(qp.error_description ? qp.error_description+ ". " : "no accessCode received from the server. ") +
54+
(qp.error_uri ? "More info: "+qp.error_uri : "");
55+
}
56+
57+
oauth2.errCb({
58+
authId: oauth2.auth.name,
59+
source: "auth",
60+
level: "error",
61+
message: oauthErrorMsg || "[Authorization failed]: no accessCode received from the server."
62+
});
63+
}
64+
} else {
65+
oauth2.callback({auth: oauth2.auth, token: qp, isValid: isValid, redirectUrl: redirectUrl});
66+
}
67+
window.close();
68+
}
69+
70+
if (document.readyState !== 'loading') {
71+
run();
72+
} else {
73+
document.addEventListener('DOMContentLoaded', function () {
74+
run();
75+
});
76+
}
77+
</script>
78+
</body>
79+
</html>

docs/demo/build-in-multiple/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,10 @@ <h2 id="markdown">Markdown</h2>
229229
<a href="#__codelineno-0-5" id="__codelineno-0-5" name="__codelineno-0-5"></a><span class="p">&lt;</span><span class="nt">swagger-ui</span> <span class="na">grouped</span> <span class="na">name</span><span class="o">=</span><span class="s">"Sample Third"</span> <span class="na">src</span><span class="o">=</span><span class="s">"./openapi-spec/sample-third.yaml"</span><span class="p">/&gt;</span>
230230
</code></pre></div>
231231
<h2 id="multiple-oas-in-single-swagger-ui">Multiple OAS in single Swagger UI</h2>
232-
<p><iframe class="swagger-ui-iframe" frameborder="0" id="2741ecb4" src="swagger-2741ecb4.html" style="overflow:hidden;width:100%;" width="100%"></iframe>
232+
<p><iframe class="swagger-ui-iframe" frameborder="0" id="214bc153" src="swagger-214bc153.html" style="overflow:hidden;width:100%;" width="100%"></iframe>
233233
</p>
234234
<h2 id="other-independent-swagger-ui">Other independent Swagger UI</h2>
235-
<p><iframe class="swagger-ui-iframe" frameborder="0" id="4f7e35d6" src="swagger-4f7e35d6.html" style="overflow:hidden;width:100%;" width="100%"></iframe></p>
235+
<p><iframe class="swagger-ui-iframe" frameborder="0" id="f55d0a45" src="swagger-f55d0a45.html" style="overflow:hidden;width:100%;" width="100%"></iframe></p>
236236
</article>
237237
<script>var input,hash=location.hash.slice(1);hash.startsWith("__tabbed_")&&((input=document.getElementById(hash)).checked=!0)</script>
238238
</div>

0 commit comments

Comments
 (0)