Skip to content

Commit d15f666

Browse files
committed
added swagger-v2 example and generated build for 7.2.1
1 parent 488db8e commit d15f666

16 files changed

+279
-71
lines changed

dist/index.html

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
./specs/oneof1.yaml <<< nested oneof
2121
2222
-->
23+
24+
<!--
2325
<rapi-doc
2426
id = "thedoc"
2527
spec-url = "https://petstore.swagger.io/v2/swagger.json"
@@ -29,13 +31,12 @@
2931
sort-endpoints-by = "method"
3032
response-area-height = "900px"
3133
> </rapi-doc>
34+
-->
3235

3336

34-
35-
<!--
3637
<rapi-doc
3738
id="thedoc"
38-
spec-url="./specs/petstore_extended.yaml"
39+
spec-url="./specs/basic.json"
3940
theme="dark"
4041
allow-api-list-style-selection = "false"
4142
render-style = "read"
@@ -50,8 +51,9 @@
5051
nav-hover-text-color = "#AA8144"
5152
nav-accent-color = "#AA8144"
5253
> </rapi-doc>
53-
-->
54-
<!--
54+
55+
<!--
56+
<rapi-doc id = "thedoc" ></rapi-doc>
5557
<script>
5658
document.addEventListener('DOMContentLoaded', (event) => {
5759
let docEl = document.getElementById("thedoc");
@@ -108,7 +110,6 @@
108110
})
109111
</script>
110112
-->
111-
112113
<script type="text/javascript" src="rapidoc-min.js"></script></body>
113114

114115
</html>

dist/index.html.gz

3 Bytes
Binary file not shown.

dist/rapidoc-min.js

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

dist/rapidoc-min.js.gz

0 Bytes
Binary file not shown.

dist/report.html

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

docs/examples/swagger-v2.html

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
10+
gtag('config', 'UA-132775238-1');
11+
</script>
12+
13+
<meta charset="utf-8">
14+
<meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes">
15+
<script type="text/javascript" src="../rapidoc-min.js"></script>
16+
<style>
17+
rapi-doc{
18+
width:100%;
19+
}
20+
</style>
21+
</head>
22+
<body>
23+
<rapi-doc spec-url="../specs/swagger-v2.json" style="min-width:460px"> </rapi-doc>
24+
</body>
25+
</html>

docs/list.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,11 @@
145145
<a href="./examples/server-vars.html"> Server Variables </a>
146146
</td>
147147
</tr>
148+
<tr>
149+
<td class="mono-bold">
150+
<a href="./examples/swagger-v2.html"> Swagger v2 spec </a>
151+
</td>
152+
</tr>
148153
<tr>
149154
<td class="mono-bold">
150155
<a href="./examples/callback.html"> Callbacks </a>

docs/rapidoc-min.js

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

docs/specs/basic.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"version" : "1.0.0",
66
"description": ""
77
},
8+
"basePath": "/my-base-path",
89
"consumes": [ "application/json"],
910
"produces": [ "application/json"],
1011
"paths": {

docs/specs/swagger-v2.json

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"swagger": "2.0",
3+
"info": {
4+
"title": "Basic Spec",
5+
"version" : "1.0.0",
6+
"description": ""
7+
},
8+
"basePath": "/my-base-path",
9+
"consumes": [ "application/json"],
10+
"produces": [ "application/json"],
11+
"paths": {
12+
"/api/employee": {
13+
"get": {
14+
"tags": ["Employee Details"],
15+
"summary": "List of employees",
16+
"operationId": "empDetails",
17+
"parameters": [
18+
{
19+
"description": "Set a limit to number of items returned",
20+
"in": "query",
21+
"name": "limit",
22+
"required": false,
23+
"type": "integer",
24+
"default": 100,
25+
"example": 50,
26+
"minimum": 1,
27+
"maximum": 100
28+
}
29+
],
30+
"responses": {
31+
"200": {
32+
"description": "Employee Schema",
33+
"schema": {
34+
"type": "array",
35+
"items": {
36+
"$ref": "#/definitions/employee"
37+
}
38+
}
39+
}
40+
}
41+
}
42+
}
43+
},
44+
"definitions": {
45+
"employee": {
46+
"description": "Employee Details",
47+
"type": "object",
48+
"additionalProperties": false,
49+
"properties": {
50+
"empId" : { "type": "string", "description": "Employee ID"},
51+
"firstName" : { "type": "string", "description": "First name" },
52+
"lastName" : { "type": "string", "description": "Last Name" },
53+
"jobTitle" : { "type": "string", "description": "Job title" },
54+
"department": { "type": "string", "description": "Department name"},
55+
"salary" : { "type": "number", "description": "Salary per annum"}
56+
}
57+
}
58+
}
59+
}

0 commit comments

Comments
 (0)