rapidoc 9.1.0 → 9.1.4
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.
- package/dist/index.html +1 -1
- package/dist/index.html.gz +0 -0
- package/dist/rapidoc-min.js +2 -5
- package/dist/rapidoc-min.js.LICENSE.txt +17 -1
- package/dist/rapidoc-min.js.LICENSE.txt.gz +0 -0
- package/dist/rapidoc-min.js.gz +0 -0
- package/dist/report.html +6 -5
- package/docker/Dockerfile +5 -5
- package/docs/api.html +48 -40
- package/docs/examples/auth-test1.html +113 -0
- package/docs/examples/auth.html +37 -34
- package/docs/examples/badges.html +1 -1
- package/docs/examples/dynamic-query-params.html +1 -0
- package/docs/examples/mongo.html +33 -0
- package/docs/examples/readwrite.html +40 -0
- package/docs/examples/slots.html +7 -0
- package/docs/examples.html +3 -2
- package/docs/index.html +2 -2
- package/docs/list.html +15 -3
- package/docs/quickstart.html +1 -1
- package/docs/rapidoc-min.js +2 -5
- package/docs/rapidoc-mini.html +20 -20
- package/docs/specs/auth-test1.yaml +35 -0
- package/docs/specs/auth.yaml +2 -2
- package/docs/specs/code-highlight.yaml +1 -1
- package/docs/specs/data-types.yaml +0 -1
- package/docs/specs/dynamic-query-params.yaml +41 -0
- package/docs/specs/examples.yaml +11 -0
- package/docs/specs/mongo.yaml +78 -0
- package/docs/specs/multipart-formdata.yaml +3 -0
- package/docs/specs/petstore_extended.yaml +1 -1
- package/docs/specs/readwrite.yaml +90 -0
- package/docs/specs/server.yaml +4 -4
- package/docs/specs/temp.json +24 -105
- package/docs/specs/temp.yaml +20 -282
- package/docs/welcome.html +3 -3
- package/index.html +11 -6
- package/package.json +22 -21
- package/src/components/api-request.js +105 -63
- package/src/components/api-response.js +10 -10
- package/src/components/json-tree.js +2 -1
- package/src/components/schema-table.js +51 -14
- package/src/components/schema-tree.js +59 -18
- package/src/components/tag-input.js +8 -1
- package/src/index.js +2 -1
- package/src/json-schema-viewer.js +341 -0
- package/src/rapidoc-mini.js +5 -1
- package/src/rapidoc.js +11 -7
- package/src/styles/font-styles.js +3 -2
- package/src/styles/nav-styles.js +2 -2
- package/src/templates/components-template.js +9 -10
- package/src/templates/endpoint-template.js +1 -1
- package/src/templates/expanded-endpoint-template.js +1 -1
- package/src/templates/focused-endpoint-template.js +1 -1
- package/src/templates/header-template.js +1 -1
- package/src/templates/json-schema-viewer-template.js +184 -0
- package/src/templates/main-body-template.js +4 -1
- package/src/templates/navbar-template.js +3 -3
- package/src/templates/overview-template.js +6 -3
- package/src/templates/security-scheme-template.js +78 -38
- package/src/templates/server-template.js +1 -1
- package/src/utils/common-utils.js +2 -1
- package/src/utils/schema-utils.js +24 -19
- package/src/utils/spec-parser.js +24 -3
- package/webpack.config.js +1 -12
- package/dist/rapidoc-min.js.map +0 -1
- package/dist/rapidoc-min.js.map.gz +0 -0
package/docs/rapidoc-mini.html
CHANGED
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
<main>
|
|
28
28
|
<h2>Introducing <rapi-doc-mini> Web Component </h2>
|
|
29
29
|
<p>
|
|
30
|
-
<b><rapi-doc-mini></b> a new way to expose your API documentation. There are various styles and
|
|
30
|
+
<b><rapi-doc-mini></b> a new way to expose your API documentation. There are various styles and needs how one would like to document their APIs.
|
|
31
31
|
such as
|
|
32
32
|
<ul>
|
|
33
33
|
<li>
|
|
34
|
-
All the APIs are documented in one central place. This is where <b><rapi-doc></b> fits in.
|
|
34
|
+
All the APIs are documented in one central place. This is where <b><rapi-doc></b> fits in. However for the rest of bullets listed below <b><rapi-doc-mini></b> is your friend
|
|
35
35
|
</li>
|
|
36
36
|
<li>
|
|
37
37
|
Expose just a few important APIs such as authentication etc as a part of a blog, to provide an initial understanding to your audience
|
|
@@ -41,13 +41,12 @@
|
|
|
41
41
|
</li>
|
|
42
42
|
<li>
|
|
43
43
|
Or you are explaining a business case which uses microservices,
|
|
44
|
-
where each microservice has its own APIs and the ask is to pick few APIs from each of theses microservice show how they
|
|
44
|
+
where each microservice has its own APIs and the ask is to pick few APIs from each of theses microservice show how they work together in a single document
|
|
45
45
|
</li>
|
|
46
46
|
</ul>
|
|
47
47
|
</p>
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
<h2>Usage in a bolg style writing</h2>
|
|
49
|
+
<h2>Usage in a blog style writing</h2>
|
|
51
50
|
<p style="flex:1">
|
|
52
51
|
It is fairly common to write specifically about few APIs to provide an initial understanding to your users.
|
|
53
52
|
However in those cases you run the risk of your writeup getting outdated when the actual API changes its shape.
|
|
@@ -69,11 +68,12 @@
|
|
|
69
68
|
bg-color = "#f9f9fb"
|
|
70
69
|
> </rapi-doc-mini></code>
|
|
71
70
|
</pre>
|
|
72
|
-
Above HTML snippet will result in generating an API doc as shown below.
|
|
71
|
+
Above HTML snippet will result in generating an API doc as shown below. Notice how it blends seamlessly with this writeup as if its a part of this page.
|
|
72
|
+
Go ahead and play with the below APIs, make live request and watch the responses, all from this very blog.
|
|
73
73
|
</p>
|
|
74
74
|
<rapi-doc-mini
|
|
75
75
|
style= "min-width:600px;"
|
|
76
|
-
spec-url="
|
|
76
|
+
spec-url="./specs/mock.yaml"
|
|
77
77
|
theme = "light"
|
|
78
78
|
paths-expanded = "false"
|
|
79
79
|
bg-color = "#f9f9fb"
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
<br/><br/>
|
|
88
88
|
<rapi-doc-mini
|
|
89
89
|
style = "width:600px;border-radius: 4px; border: 2px solid #333; box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);"
|
|
90
|
-
spec-url="
|
|
90
|
+
spec-url="./specs/mock.yaml"
|
|
91
91
|
theme = "light"
|
|
92
92
|
schema-style = 'table'
|
|
93
93
|
sort-endpoints-by = "method"
|
|
@@ -95,9 +95,8 @@
|
|
|
95
95
|
paths-expanded = "false"
|
|
96
96
|
> </rapi-doc-mini>
|
|
97
97
|
|
|
98
|
-
|
|
99
98
|
<br/><br/>
|
|
100
|
-
<h3>Pick
|
|
99
|
+
<h3>Pick only specific APIs from OpenAPI spec</h3>
|
|
101
100
|
Instead of showing entire open-api spec you can just extract and choose to show what you need to show. This is done using <b>match-paths</b> attribute.
|
|
102
101
|
<br/>Example below uses the same OpenAPI spec as we used above, but showing only the paths that we intend to
|
|
103
102
|
|
|
@@ -115,7 +114,7 @@
|
|
|
115
114
|
<br/>
|
|
116
115
|
<rapi-doc-mini
|
|
117
116
|
style= "min-width:600px; width:600px; border-radius:2px; border: 1px solid #eee; border-top-width:0"
|
|
118
|
-
spec-url="
|
|
117
|
+
spec-url="./specs/mock.yaml"
|
|
119
118
|
theme = "light"
|
|
120
119
|
schema-style = 'table'
|
|
121
120
|
sort-endpoints-by = "method"
|
|
@@ -125,11 +124,12 @@
|
|
|
125
124
|
> </rapi-doc-mini>
|
|
126
125
|
<br/>
|
|
127
126
|
<h3>More complex RegEx based filtering of API is possible too (match-paths & match-type)</h3>
|
|
127
|
+
Here we are using regular RegEx to select the paths which is either <span class="mono blue"> get /users/{userId}</span> or <span class="mono blue"> post /users</span>
|
|
128
128
|
<pre class="shadow1 code-block" style="width:575px">
|
|
129
129
|
<code class="language-html">
|
|
130
130
|
<rapi-doc-mini
|
|
131
131
|
style= "min-width:600px;border: 1px solid #eee; border-top-width:0"
|
|
132
|
-
spec-url="
|
|
132
|
+
spec-url="./specs/mock.yaml"
|
|
133
133
|
theme = "light"
|
|
134
134
|
paths-expanded = "false"
|
|
135
135
|
match-paths = "^get /users/\{userId\}$|^post /users$"
|
|
@@ -141,7 +141,7 @@
|
|
|
141
141
|
<br/>
|
|
142
142
|
<rapi-doc-mini
|
|
143
143
|
style= "min-width:600px; width:600px; border-radius:2px; border: 1px solid #eee; border-top-width:0"
|
|
144
|
-
spec-url="
|
|
144
|
+
spec-url="./specs/mock.yaml"
|
|
145
145
|
theme = "light"
|
|
146
146
|
schema-style = 'table'
|
|
147
147
|
sort-endpoints-by = "method"
|
|
@@ -152,12 +152,12 @@
|
|
|
152
152
|
> </rapi-doc-mini>
|
|
153
153
|
|
|
154
154
|
<h3>Show it Minimzed or Expanded</h3>
|
|
155
|
-
If expand/collapse is not your style,
|
|
155
|
+
If expand/collapse is not your style, then have it always expanded and make it more natural and integrated part of your writeup.
|
|
156
156
|
<br> Use the attribute <b>paths-expanded = "true"</b> to achive this <br/><br/>
|
|
157
157
|
|
|
158
158
|
<rapi-doc-mini
|
|
159
159
|
style= "min-width:600px; width:600px;"
|
|
160
|
-
spec-url="
|
|
160
|
+
spec-url="./specs/mock.yaml"
|
|
161
161
|
theme = "light"
|
|
162
162
|
schema-style = 'table'
|
|
163
163
|
sort-endpoints-by = "method"
|
|
@@ -179,7 +179,7 @@
|
|
|
179
179
|
<rapi-doc-mini
|
|
180
180
|
style= "width:600px; border-radius: 4px; border: 1px solid #333"
|
|
181
181
|
id = "thedoc"
|
|
182
|
-
spec-url="
|
|
182
|
+
spec-url="./specs/code-highlight.yaml"
|
|
183
183
|
theme = "light"
|
|
184
184
|
schema-style = 'table'
|
|
185
185
|
sort-endpoints-by = "method"
|
|
@@ -191,7 +191,7 @@
|
|
|
191
191
|
<rapi-doc-mini
|
|
192
192
|
style= "width:600px; border-radius: 4px; box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);"
|
|
193
193
|
id = "thedoc"
|
|
194
|
-
spec-url="
|
|
194
|
+
spec-url="./specs/petstore.json"
|
|
195
195
|
theme = "dark"
|
|
196
196
|
schema-style = 'table'
|
|
197
197
|
sort-endpoints-by = "method"
|
|
@@ -204,16 +204,16 @@
|
|
|
204
204
|
style= "width:600px; border-radius: 4px; margin-bottom: 16px;"
|
|
205
205
|
theme = "dark"
|
|
206
206
|
id = "thedoc"
|
|
207
|
-
spec-url="
|
|
207
|
+
spec-url="./specs/fake-non-existing.json"
|
|
208
208
|
> </rapi-doc-mini>
|
|
209
209
|
<rapi-doc-mini
|
|
210
210
|
style= "width:600px; border-radius: 4px; margin-bottom: 16px;"
|
|
211
211
|
theme = "light"
|
|
212
212
|
id = "thedoc"
|
|
213
|
-
spec-url="
|
|
213
|
+
spec-url="./specs/fake-non-existing.json"
|
|
214
214
|
> </rapi-doc-mini>
|
|
215
215
|
|
|
216
216
|
</main>
|
|
217
217
|
|
|
218
218
|
</body>
|
|
219
|
-
</html>
|
|
219
|
+
</html>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
openapi: 3.0.1
|
|
2
|
+
info:
|
|
3
|
+
title: Authentication Test Case
|
|
4
|
+
description: Demonstrate various authentication methods supported by RapiDoc
|
|
5
|
+
servers:
|
|
6
|
+
- url: https://reqres.in/api/
|
|
7
|
+
paths:
|
|
8
|
+
/users/{userId}:
|
|
9
|
+
get:
|
|
10
|
+
description: Uses HTTP Basic Auth
|
|
11
|
+
parameters:
|
|
12
|
+
- in: path
|
|
13
|
+
name: userId
|
|
14
|
+
schema:
|
|
15
|
+
type: integer
|
|
16
|
+
example: 3
|
|
17
|
+
required: true
|
|
18
|
+
description: Numeric ID of the user to get
|
|
19
|
+
security:
|
|
20
|
+
- http-basic: []
|
|
21
|
+
|
|
22
|
+
/users:
|
|
23
|
+
get:
|
|
24
|
+
description: Uses API Key Auth
|
|
25
|
+
security:
|
|
26
|
+
- api_key1: []
|
|
27
|
+
components:
|
|
28
|
+
securitySchemes:
|
|
29
|
+
http-basic:
|
|
30
|
+
type: http
|
|
31
|
+
scheme: basic
|
|
32
|
+
api_key1:
|
|
33
|
+
type: apiKey
|
|
34
|
+
name: Authorization
|
|
35
|
+
in: header
|
package/docs/specs/auth.yaml
CHANGED
|
@@ -48,9 +48,9 @@ paths:
|
|
|
48
48
|
- ms-oauth:
|
|
49
49
|
- User.ReadBasic.All
|
|
50
50
|
- Directory.Read.All
|
|
51
|
-
- http-basic: []
|
|
51
|
+
- http-basic: ['h-scope1', 'h-scope2']
|
|
52
52
|
- api_key_cookie: []
|
|
53
|
-
- api_key1: []
|
|
53
|
+
- api_key1: ['a-scope1', 'a-scope2']
|
|
54
54
|
api_key2: []
|
|
55
55
|
components:
|
|
56
56
|
securitySchemes:
|
|
@@ -60,7 +60,7 @@ info:
|
|
|
60
60
|
|
|
61
61
|
<html>
|
|
62
62
|
<head>
|
|
63
|
-
<meta charset="utf-8"> <!-- Important: rapi-doc uses utf8
|
|
63
|
+
<meta charset="utf-8"> <!-- Important: rapi-doc uses utf8 characters -->
|
|
64
64
|
<script type="module" src="https://unpkg.com/rapidoc/dist/rapidoc-min.js"></script>
|
|
65
65
|
</head>
|
|
66
66
|
<body>
|
|
@@ -75,6 +75,25 @@ paths:
|
|
|
75
75
|
type: string
|
|
76
76
|
additionalProperties:
|
|
77
77
|
type: string
|
|
78
|
+
- in: query
|
|
79
|
+
name: dynamic-query-params5
|
|
80
|
+
explode: false
|
|
81
|
+
required: false
|
|
82
|
+
schema:
|
|
83
|
+
type: object
|
|
84
|
+
properties:
|
|
85
|
+
propertyOne:
|
|
86
|
+
type: string
|
|
87
|
+
enum:
|
|
88
|
+
- VALUE-1
|
|
89
|
+
- VALUE-2
|
|
90
|
+
default: VALUE-2
|
|
91
|
+
propertyTwo:
|
|
92
|
+
type: string
|
|
93
|
+
enum:
|
|
94
|
+
- FLAG-1
|
|
95
|
+
- FLAG-2
|
|
96
|
+
default: FLAG-1
|
|
78
97
|
responses:
|
|
79
98
|
'200':
|
|
80
99
|
description: successful operation
|
|
@@ -187,6 +206,28 @@ paths:
|
|
|
187
206
|
type: string
|
|
188
207
|
additionalProperties:
|
|
189
208
|
type: string
|
|
209
|
+
- in: query
|
|
210
|
+
name: dynamic-query-params5
|
|
211
|
+
description: >
|
|
212
|
+
Example generation works for non-exloded objects:<br />
|
|
213
|
+
`propertyOne=VALUE-1&property2=FLAG-1`
|
|
214
|
+
explode: false
|
|
215
|
+
required: false
|
|
216
|
+
schema:
|
|
217
|
+
type: object
|
|
218
|
+
properties:
|
|
219
|
+
propertyOne:
|
|
220
|
+
type: string
|
|
221
|
+
enum:
|
|
222
|
+
- VALUE-1
|
|
223
|
+
- VALUE-2
|
|
224
|
+
default: VALUE-2
|
|
225
|
+
propertyTwo:
|
|
226
|
+
type: string
|
|
227
|
+
enum:
|
|
228
|
+
- FLAG-1
|
|
229
|
+
- FLAG-2
|
|
230
|
+
default: FLAG-1
|
|
190
231
|
responses:
|
|
191
232
|
'200':
|
|
192
233
|
description: successful operation
|
package/docs/specs/examples.yaml
CHANGED
|
@@ -60,6 +60,17 @@ paths:
|
|
|
60
60
|
value: "unmarried"
|
|
61
61
|
example3:
|
|
62
62
|
value: "widowed"
|
|
63
|
+
- name: luckyNumbers
|
|
64
|
+
in: query
|
|
65
|
+
schema:
|
|
66
|
+
type: array
|
|
67
|
+
items:
|
|
68
|
+
type: number
|
|
69
|
+
minItems: 4
|
|
70
|
+
maxItems: 4
|
|
71
|
+
examples:
|
|
72
|
+
- [10]
|
|
73
|
+
- [10, 20, 30, 40]
|
|
63
74
|
|
|
64
75
|
/multiple-examples-by-response-type:
|
|
65
76
|
get:
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
jsonSchemaViewer: 1.0.0
|
|
2
|
+
info:
|
|
3
|
+
title: Database Schema
|
|
4
|
+
schemaAndExamples:
|
|
5
|
+
users1:
|
|
6
|
+
description: Optionally may provide some Description about the schema. Can contain `markdown` syntax
|
|
7
|
+
schema:
|
|
8
|
+
$ref: '#/components/schemas/users'
|
|
9
|
+
examples:
|
|
10
|
+
- valid-json:
|
|
11
|
+
summary: Example with Valid JSON String
|
|
12
|
+
description: If valid JSON is provided in the example, It will be displayed in JSON tree form. Allowing copy/expand/collapse functionality
|
|
13
|
+
value: |
|
|
14
|
+
{
|
|
15
|
+
"person": {
|
|
16
|
+
"fullName": {
|
|
17
|
+
"firstName": "Mickey",
|
|
18
|
+
"lastName": "Mouse"
|
|
19
|
+
},
|
|
20
|
+
"age": "9"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
- invalid-json:
|
|
24
|
+
summary: Example with Invalid JSON String
|
|
25
|
+
description: Invalid JSON is displayed in text-area as is
|
|
26
|
+
value: |
|
|
27
|
+
{
|
|
28
|
+
person: {
|
|
29
|
+
fullName: {
|
|
30
|
+
firstName: Donald,
|
|
31
|
+
lastName: Duck
|
|
32
|
+
},
|
|
33
|
+
age: 10
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
- as-object:
|
|
37
|
+
summary: Example specified as object
|
|
38
|
+
value:
|
|
39
|
+
fullName:
|
|
40
|
+
firstName: Donald
|
|
41
|
+
lastName: Duck
|
|
42
|
+
age: 10
|
|
43
|
+
users2:
|
|
44
|
+
schema:
|
|
45
|
+
$ref: '#/components/schemas/users'
|
|
46
|
+
|
|
47
|
+
components:
|
|
48
|
+
schemas:
|
|
49
|
+
users:
|
|
50
|
+
type: object
|
|
51
|
+
properties:
|
|
52
|
+
id:
|
|
53
|
+
description: User ID
|
|
54
|
+
type: integer
|
|
55
|
+
email:
|
|
56
|
+
description: User Email
|
|
57
|
+
type: string
|
|
58
|
+
first_name:
|
|
59
|
+
description: First Name
|
|
60
|
+
type: string
|
|
61
|
+
last_name:
|
|
62
|
+
description: Last Name
|
|
63
|
+
type: string
|
|
64
|
+
avatar:
|
|
65
|
+
description: Avatar URL
|
|
66
|
+
type: string
|
|
67
|
+
tenants:
|
|
68
|
+
type: object
|
|
69
|
+
properties:
|
|
70
|
+
url:
|
|
71
|
+
description: Support URL
|
|
72
|
+
type: string
|
|
73
|
+
text:
|
|
74
|
+
description: Support URL - Description
|
|
75
|
+
type: string
|
|
76
|
+
external:
|
|
77
|
+
$ref: '../specs/tenants.json'
|
|
78
|
+
|
|
@@ -11,6 +11,8 @@ paths:
|
|
|
11
11
|
multipart/form-data:
|
|
12
12
|
schema:
|
|
13
13
|
type: object
|
|
14
|
+
required:
|
|
15
|
+
- agePart
|
|
14
16
|
properties:
|
|
15
17
|
photoPart:
|
|
16
18
|
type: string
|
|
@@ -27,6 +29,7 @@ paths:
|
|
|
27
29
|
agePart:
|
|
28
30
|
type: integer
|
|
29
31
|
default: 21
|
|
32
|
+
deprecated: true
|
|
30
33
|
description: 'Age of the person'
|
|
31
34
|
contactPart:
|
|
32
35
|
type: object
|
|
@@ -69,7 +69,7 @@ info:
|
|
|
69
69
|
<!doctype html> <!-- Important: must specify -->
|
|
70
70
|
<html>
|
|
71
71
|
<head>
|
|
72
|
-
<meta charset="utf-8"> <!-- Important: rapi-doc uses utf8
|
|
72
|
+
<meta charset="utf-8"> <!-- Important: rapi-doc uses utf8 characters -->
|
|
73
73
|
<script type="module" src="https://unpkg.com/rapidoc/dist/rapidoc-min.js"></script>
|
|
74
74
|
</head>
|
|
75
75
|
<body>
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
openapi: 3.0.3
|
|
2
|
+
info:
|
|
3
|
+
version: "1.0.0"
|
|
4
|
+
title: "RaedOnly and WriteOnly Testcase "
|
|
5
|
+
paths:
|
|
6
|
+
/read-write:
|
|
7
|
+
post:
|
|
8
|
+
summary: "Request doesn't show the read-only and Response doesn't show write-only"
|
|
9
|
+
requestBody:
|
|
10
|
+
content:
|
|
11
|
+
application/json:
|
|
12
|
+
schema:
|
|
13
|
+
properties:
|
|
14
|
+
holder:
|
|
15
|
+
$ref: '#/components/schemas/Holder'
|
|
16
|
+
responses:
|
|
17
|
+
'200':
|
|
18
|
+
description: Successful operation
|
|
19
|
+
content:
|
|
20
|
+
application/json:
|
|
21
|
+
schema:
|
|
22
|
+
type: array
|
|
23
|
+
items:
|
|
24
|
+
$ref: '#/components/schemas/Holder'
|
|
25
|
+
|
|
26
|
+
components:
|
|
27
|
+
schemas:
|
|
28
|
+
Holder:
|
|
29
|
+
type: object
|
|
30
|
+
properties:
|
|
31
|
+
id:
|
|
32
|
+
type: integer
|
|
33
|
+
name:
|
|
34
|
+
type: string
|
|
35
|
+
others:
|
|
36
|
+
$ref: '#/components/schemas/other'
|
|
37
|
+
other:
|
|
38
|
+
type: object
|
|
39
|
+
required:
|
|
40
|
+
- obj-regular
|
|
41
|
+
properties:
|
|
42
|
+
primitive:
|
|
43
|
+
type: integer
|
|
44
|
+
primitive-readonly:
|
|
45
|
+
readOnly: true
|
|
46
|
+
type: integer
|
|
47
|
+
obj-regular:
|
|
48
|
+
type: object
|
|
49
|
+
properties:
|
|
50
|
+
obj-prop1:
|
|
51
|
+
type: integer
|
|
52
|
+
obj-prop2:
|
|
53
|
+
type: integer
|
|
54
|
+
obj-prop-readonly:
|
|
55
|
+
readOnly: true
|
|
56
|
+
type: integer
|
|
57
|
+
obj-prop-writeonly:
|
|
58
|
+
writeOnly: true
|
|
59
|
+
type: integer
|
|
60
|
+
primitive-writeonly:
|
|
61
|
+
writeOnly: true
|
|
62
|
+
type: integer
|
|
63
|
+
obj-readonly:
|
|
64
|
+
type: object
|
|
65
|
+
readOnly: true
|
|
66
|
+
properties:
|
|
67
|
+
c1:
|
|
68
|
+
type: integer
|
|
69
|
+
c2:
|
|
70
|
+
type: integer
|
|
71
|
+
obj-writeonly:
|
|
72
|
+
type: object
|
|
73
|
+
writeOnly: true
|
|
74
|
+
properties:
|
|
75
|
+
d1:
|
|
76
|
+
type: integer
|
|
77
|
+
d2:
|
|
78
|
+
type: integer
|
|
79
|
+
arr-readonly:
|
|
80
|
+
type: array
|
|
81
|
+
readOnly: true
|
|
82
|
+
items:
|
|
83
|
+
type: string
|
|
84
|
+
arr-writeonly:
|
|
85
|
+
type: array
|
|
86
|
+
writeOnly: true
|
|
87
|
+
items:
|
|
88
|
+
type: string
|
|
89
|
+
g:
|
|
90
|
+
type: integer
|
package/docs/specs/server.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
openapi: 3.0.2
|
|
2
2
|
info:
|
|
3
3
|
version: '1.0'
|
|
4
|
-
title: Server
|
|
4
|
+
title: API Server templating using variables
|
|
5
5
|
description: >
|
|
6
6
|
Various ways to define API servers in the spec including variables
|
|
7
7
|
|
|
@@ -84,10 +84,10 @@ servers:
|
|
|
84
84
|
- v1
|
|
85
85
|
- v2
|
|
86
86
|
paths:
|
|
87
|
-
/server-
|
|
87
|
+
/api-server-template:
|
|
88
88
|
get:
|
|
89
|
-
summary: Server
|
|
90
|
-
|
|
89
|
+
summary: Dynamic API Server.
|
|
90
|
+
description: Uses API server template string and variables which can be used to generatea a desired API server url - The selected and computed API Server URL should be shown against `API SERVER`.
|
|
91
91
|
responses:
|
|
92
92
|
'200':
|
|
93
93
|
description: successful operation
|
package/docs/specs/temp.json
CHANGED
|
@@ -1,115 +1,34 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
2
|
+
"components": {},
|
|
3
3
|
"info": {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
"version": "1.0.0"
|
|
4
|
+
"title": "Example Schema",
|
|
5
|
+
"version": "0.0.1"
|
|
7
6
|
},
|
|
8
|
-
"
|
|
9
|
-
{
|
|
10
|
-
"url": "https://picsum.photos/",
|
|
11
|
-
"description": "picsum photos"
|
|
12
|
-
}
|
|
13
|
-
],
|
|
7
|
+
"openapi": "3.0.3",
|
|
14
8
|
"paths": {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
{
|
|
35
|
-
"name": "height",
|
|
36
|
-
"in": "path",
|
|
37
|
-
"description": "photo height",
|
|
38
|
-
"required": true,
|
|
39
|
-
"example": 100,
|
|
40
|
-
"schema": {
|
|
41
|
-
"minimum": 100,
|
|
42
|
-
"type": "integer",
|
|
43
|
-
"format": "int32"
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
],
|
|
47
|
-
"responses": {
|
|
48
|
-
"200": {
|
|
49
|
-
"description": "Default response",
|
|
50
|
-
"content": {
|
|
51
|
-
"application/json": {
|
|
52
|
-
"schema": {
|
|
53
|
-
"type": "object",
|
|
54
|
-
"properties": {
|
|
55
|
-
"data": {
|
|
56
|
-
"type": "object",
|
|
57
|
-
"properties": {
|
|
58
|
-
"attributes": {
|
|
59
|
-
"type": "object",
|
|
60
|
-
"properties": {
|
|
61
|
-
"randomId": {
|
|
62
|
-
"type": "integer"
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
"anyOf": [
|
|
66
|
-
{
|
|
67
|
-
"oneOf": [
|
|
68
|
-
{
|
|
69
|
-
"properties": {
|
|
70
|
-
"title1": {
|
|
71
|
-
"type": "string"
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
"properties": {
|
|
77
|
-
"examId1": {
|
|
78
|
-
"type": "integer"
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
]
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
"oneOf": [
|
|
86
|
-
{
|
|
87
|
-
"properties": {
|
|
88
|
-
"title2": {
|
|
89
|
-
"type": "string"
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
"properties": {
|
|
95
|
-
"examId2": {
|
|
96
|
-
"type": "integer"
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
]
|
|
101
|
-
}
|
|
102
|
-
]
|
|
103
|
-
}
|
|
9
|
+
"/api/v1/example": {
|
|
10
|
+
"get": {
|
|
11
|
+
"operationId": "v1_example",
|
|
12
|
+
"description": "Example API",
|
|
13
|
+
"parameters": [
|
|
14
|
+
{
|
|
15
|
+
"in": "query",
|
|
16
|
+
"name": "boolean_query_parameter",
|
|
17
|
+
"schema": {
|
|
18
|
+
"type": "boolean",
|
|
19
|
+
"default": false
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"in": "query",
|
|
24
|
+
"name": "integer_query_parameter",
|
|
25
|
+
"schema": {
|
|
26
|
+
"type": "integer",
|
|
27
|
+
"default": 0
|
|
104
28
|
}
|
|
105
|
-
}
|
|
106
29
|
}
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
}
|
|
30
|
+
]
|
|
110
31
|
}
|
|
111
|
-
}
|
|
112
32
|
}
|
|
113
|
-
}
|
|
114
33
|
}
|
|
115
34
|
}
|