Skip to content

Commit 4957337

Browse files
authored
Merge pull request #1 from mrin9/master
Merge base
2 parents 30d9e02 + cb34cdd commit 4957337

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+2767
-510
lines changed

dist/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1,user-scalable=yes"><title>RapiDoc</title><link href="https://fonts.googleapis.com/css?family=Open+Sans:300,600&display=swap" rel="stylesheet"><link rel="stylesheet" href="//cdn.jsdelivr.net/gh/highlightjs/[email protected]/build/styles/default.min.css"><script src="//cdn.jsdelivr.net/gh/highlightjs/[email protected]/build/highlight.min.js"></script></head><body><rapi-doc id="thedoc" spec-url="./specs/temp.yaml" allow-server-selection="false" show-header="false" theme="light" allow-try="false" allow-api-list-style-selection="false" regular-font="Open Sans" schema-style="tree" render-style="read" default-schema-tab="model"></rapi-doc><script src="rapidoc-min.js"></script></body></html>
1+
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1,user-scalable=yes"><title>RapiDoc</title><link href="https://fonts.googleapis.com/css?family=Open+Sans:300,600&display=swap" rel="stylesheet"><link rel="stylesheet" href="//cdn.jsdelivr.net/gh/highlightjs/[email protected]/build/styles/default.min.css"><script src="//cdn.jsdelivr.net/gh/highlightjs/[email protected]/build/highlight.min.js"></script></head><body><rapi-doc id="thedoc" spec-url="./specs/temp.yaml" allow-server-selection="false" show-header="false" theme="dark" allow-try="true" allow-api-list-style-selection="false" regular-font="Open Sans" schema-style="tree" render-style="view" default-schema-tab="example"></rapi-doc><script src="rapidoc-min.js"></script></body></html>

dist/index.html.gz

4 Bytes
Binary file not shown.

dist/rapidoc-min.js

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

dist/rapidoc-min.js.gz

8.7 KB
Binary file not shown.

dist/rapidoc-min.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.

dist/rapidoc-min.js.map.gz

10 Bytes
Binary file not shown.

dist/report.html

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

docs/api.html

Lines changed: 42 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,15 @@ <h2> Attributes</h2>
194194
<a id="att-nav"></a>
195195
<div class='table-title' id="nav-bar-colors"> Navigation bar settings (only applicable in read-mode)</div>
196196
<table class="m-table">
197+
<tr>
198+
<td class=" attr-col mono bold right">use-path-in-nav-bar </td>
199+
<td class="gray">
200+
<span class='bold dark-gray'>Allowed:<span class='blue'> true | false</span></span>
201+
set true to show API paths in the navigation bar instead of summary/description
202+
</td>
203+
<td class='default-col'>false</td>
204+
</tr>
205+
197206
<tr>
198207
<td class=" attr-col mono bold right">nav-bg-color </td>
199208
<td class="gray"> Navigation bar's background color </td>
@@ -404,44 +413,58 @@ <h2> Attributes</h2>
404413
<div class='table-title' id='api-servers'> API Server</div>
405414
<table class="m-table">
406415
<tr>
407-
<td class="attr-col mono bold right">api-key-name</td>
408-
<td class="gray">Name of the API key that will be send while trying out the APIs</td>
409-
<td class='default-col'>Authorization</td>
416+
<td class="mono bold right">server-url</td>
417+
<td class="gray">
418+
OpenAPI spec has a provision for providing the server url. The UI will list all the server URLs provided in the spec.
419+
The user can then select one URL to which he or she intends to send API calls while trying out the apis.
420+
However, if you want to provide an API server of your own which is not listed in the spec, you can use this property to provide one.
421+
It is helpful in the cases where the same spec is shared between multiple environment say Dev and Test and each have their own API server.
422+
</td>
423+
<td>(empty)</td>
410424
</tr>
411425
<tr>
412-
<td class="mono bold right">api-key-value</td>
426+
<td class="mono bold right">default-api-server</td>
413427
<td class="gray">
414-
Value of the API key that will be send while trying out the APIs.
415-
This can also be provided/overwritten from UI.
428+
If you have multiple api-server listed in the spec, use this attribute to select the default API server, where all the API calls will goto.
429+
This can be changed later from the UI
416430
</td>
417431
<td>(empty)</td>
418432
</tr>
419433
<tr>
420-
<td class="mono bold right">api-key-location</td>
421-
<td class="gray">
422-
<span class='bold dark-gray'>Allowed:<span class='blue'> header, query</span></span> -
423-
determines how you want to send the api-key.
434+
<td colspan="3" style="border-bottom-style:dashed; text-align: center;">
435+
<br/>
436+
When providing API key using RapiDoc element, make sure that you provide all the 3 attributes with some default values
437+
<span class="mono blue">api-key-name, api-key-location & api-key-value</span>
438+
<br/>
439+
Set <span class="mono blue">api-key-value</span> to "<span class="mono blue">-</span>"
440+
if you are unsure of its value, and like to fill in later using JavaScript
441+
<br/><br/>
424442
</td>
425-
<td>header</td>
443+
444+
</tr>
445+
<tr>
446+
<td class="attr-col mono bold right">api-key-name</td>
447+
<td class="gray">Name of the API key that will be send while trying out the APIs</td>
448+
<td class='default-col'>(empty)</td>
426449
</tr>
427450
<tr>
428-
<td class="mono bold right">server-url</td>
451+
<td class="mono bold right">api-key-location</td>
429452
<td class="gray">
430-
OpenAPI spec has a provision for providing the server url. The UI will list all the server URLs provided in the spec.
431-
The user can then select one URL to which he or she intends to send API calls while trying out the apis.
432-
However, if you want to provide an API server of your own which is not listed in the spec, you can use this property to provide one.
433-
It is helpful in the cases where the same spec is shared between multiple environment say Dev and Test and each have their own API server.
453+
<span class='bold dark-gray'>Allowed:<span class='blue'> header, query</span></span> -
454+
determines how you want to send the api-key.
434455
</td>
435456
<td>(empty)</td>
436457
</tr>
437458
<tr>
438-
<td class="mono bold right">default-api-server</td>
459+
<td class="mono bold right">api-key-value</td>
439460
<td class="gray">
440-
If you have multiple api-server listed in the spec, use this attribute to select the default API server, where all the API calls will goto.
441-
This can be changed later from the UI
461+
Value of the API key that will be send while trying out the APIs.
462+
This can also be provided/overwritten from UI.
442463
</td>
443464
<td>(empty)</td>
444465
</tr>
466+
467+
445468
</table>
446469

447470
</div>

docs/examples/api-key.html

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<!doctype html>
2+
<head>
3+
<!-- Global site tag (gtag.js) - Google Analytics -->
4+
<script async src='https://www.googletagmanager.com/gtag/js?id=UA-132775238-1'></script>
5+
<script>
6+
window.dataLayer = window.dataLayer || [];
7+
function gtag(){dataLayer.push(arguments);}
8+
gtag('js', new Date());
9+
gtag('config', 'UA-132775238-1');
10+
</script>
11+
<meta charset='utf-8'>
12+
<meta name='viewport' content='width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes'>
13+
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;600&family=Roboto+Mono&display=swap" rel="stylesheet">
14+
<style>
15+
.btn {
16+
width: 90px;
17+
height: 32px;
18+
font-size:13px;
19+
background-color: #47AFE8;
20+
color: #fff;
21+
border: none;
22+
margin: 0 2px;
23+
border-radius: 2px;
24+
cursor:pointer;
25+
outline:none;
26+
}
27+
.txt{
28+
width: 100px;
29+
height: 30px;
30+
font-size:13px;
31+
background-color: #333;
32+
border: 1px solid #47AFE8;
33+
color: #fff;
34+
padding:0 8px;
35+
margin: 0 2px;
36+
border-radius: 2px;
37+
outline:none;
38+
}
39+
rapi-doc{
40+
width:100%;
41+
}
42+
</style>
43+
<script type='text/javascript' src='../rapidoc-min.js'></script>
44+
<script>
45+
function setApiKey(){
46+
const docEl = document.getElementById('thedoc');
47+
const keyInputEl = document.getElementById('key-val-input');
48+
49+
docEl.setAttribute('api-key-name','api_key');
50+
docEl.setAttribute('api-key-location','header');
51+
docEl.setAttribute('api-key-value', keyInputEl.value);
52+
if (keyInputEl.value.trim()) {
53+
document.getElementById('header-msg').innerHTML = "<span style='color:lime'>Auth Key Applied</span>";
54+
} else {
55+
document.getElementById('header-msg').innerHTML = "<span style='color:orangered'>Removed Key</span>"
56+
}
57+
}
58+
</script>
59+
</head>
60+
<body>
61+
<rapi-doc id='thedoc'
62+
spec-url='../specs/api-key.yaml'
63+
allow-authentication = "false"
64+
regular-font = "Open Sans"
65+
mono-font = "Roboto Mono"
66+
allow-spec-file-load = "false"
67+
api-key-name = "api_key"
68+
api-key-location = "header"
69+
api-key-value = "-"
70+
render-style="read"
71+
>
72+
<div slot='header' >
73+
<input class='txt' id='key-val-input' type='text' placeholder='API Key' value='special-key' spellcheck='false' >
74+
<button class='btn' onclick='setApiKey()'>SET KEY</button>
75+
<span id="header-msg"></span>
76+
</div>
77+
</rapi-doc>
78+
</body>
79+
</html>

docs/examples/example8.html

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,16 @@
6464
regular-font = "Open Sans"
6565
mono-font = "Roboto Mono"
6666
allow-spec-file-load = "false"
67+
api-key-name = "api_key"
68+
api-key-location = "header"
69+
api-key-value = "-"
70+
render-style="read"
6771
>
68-
<div slot='header' >
69-
<input class='txt' id='key-val-input' type='text' placeholder='API Key' value='special-key' spellcheck='false' >
70-
<button class='btn' onclick='setApiKey()'>SET KEY</button>
71-
<span id="header-msg"></span>
72-
</div>
72+
<div slot='header' >
73+
<input class='txt' id='key-val-input' type='text' placeholder='API Key' value='special-key' spellcheck='false' >
74+
<button class='btn' onclick='setApiKey()'>SET KEY</button>
75+
<span id="header-msg"></span>
76+
</div>
7377
</rapi-doc>
7478
</body>
7579
</html>

0 commit comments

Comments
 (0)