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.
Files changed (67) hide show
  1. package/dist/index.html +1 -1
  2. package/dist/index.html.gz +0 -0
  3. package/dist/rapidoc-min.js +2 -5
  4. package/dist/rapidoc-min.js.LICENSE.txt +17 -1
  5. package/dist/rapidoc-min.js.LICENSE.txt.gz +0 -0
  6. package/dist/rapidoc-min.js.gz +0 -0
  7. package/dist/report.html +6 -5
  8. package/docker/Dockerfile +5 -5
  9. package/docs/api.html +48 -40
  10. package/docs/examples/auth-test1.html +113 -0
  11. package/docs/examples/auth.html +37 -34
  12. package/docs/examples/badges.html +1 -1
  13. package/docs/examples/dynamic-query-params.html +1 -0
  14. package/docs/examples/mongo.html +33 -0
  15. package/docs/examples/readwrite.html +40 -0
  16. package/docs/examples/slots.html +7 -0
  17. package/docs/examples.html +3 -2
  18. package/docs/index.html +2 -2
  19. package/docs/list.html +15 -3
  20. package/docs/quickstart.html +1 -1
  21. package/docs/rapidoc-min.js +2 -5
  22. package/docs/rapidoc-mini.html +20 -20
  23. package/docs/specs/auth-test1.yaml +35 -0
  24. package/docs/specs/auth.yaml +2 -2
  25. package/docs/specs/code-highlight.yaml +1 -1
  26. package/docs/specs/data-types.yaml +0 -1
  27. package/docs/specs/dynamic-query-params.yaml +41 -0
  28. package/docs/specs/examples.yaml +11 -0
  29. package/docs/specs/mongo.yaml +78 -0
  30. package/docs/specs/multipart-formdata.yaml +3 -0
  31. package/docs/specs/petstore_extended.yaml +1 -1
  32. package/docs/specs/readwrite.yaml +90 -0
  33. package/docs/specs/server.yaml +4 -4
  34. package/docs/specs/temp.json +24 -105
  35. package/docs/specs/temp.yaml +20 -282
  36. package/docs/welcome.html +3 -3
  37. package/index.html +11 -6
  38. package/package.json +22 -21
  39. package/src/components/api-request.js +105 -63
  40. package/src/components/api-response.js +10 -10
  41. package/src/components/json-tree.js +2 -1
  42. package/src/components/schema-table.js +51 -14
  43. package/src/components/schema-tree.js +59 -18
  44. package/src/components/tag-input.js +8 -1
  45. package/src/index.js +2 -1
  46. package/src/json-schema-viewer.js +341 -0
  47. package/src/rapidoc-mini.js +5 -1
  48. package/src/rapidoc.js +11 -7
  49. package/src/styles/font-styles.js +3 -2
  50. package/src/styles/nav-styles.js +2 -2
  51. package/src/templates/components-template.js +9 -10
  52. package/src/templates/endpoint-template.js +1 -1
  53. package/src/templates/expanded-endpoint-template.js +1 -1
  54. package/src/templates/focused-endpoint-template.js +1 -1
  55. package/src/templates/header-template.js +1 -1
  56. package/src/templates/json-schema-viewer-template.js +184 -0
  57. package/src/templates/main-body-template.js +4 -1
  58. package/src/templates/navbar-template.js +3 -3
  59. package/src/templates/overview-template.js +6 -3
  60. package/src/templates/security-scheme-template.js +78 -38
  61. package/src/templates/server-template.js +1 -1
  62. package/src/utils/common-utils.js +2 -1
  63. package/src/utils/schema-utils.js +24 -19
  64. package/src/utils/spec-parser.js +24 -3
  65. package/webpack.config.js +1 -12
  66. package/dist/rapidoc-min.js.map +0 -1
  67. package/dist/rapidoc-min.js.map.gz +0 -0
@@ -1,298 +1,36 @@
1
1
  openapi: 3.0.0
2
2
  info:
3
- description: Contains all data types
3
+ title: all-of Models
4
+ description: Model composition using all-of
4
5
  version: 1.0.0
5
- title: Testing different data-types
6
6
  paths:
7
- /nested-object-in-request-body:
8
- post:
9
- tags:
10
- - Test with various data types
11
- summary: Request Body accepting a JSON
12
- requestBody:
13
- content:
14
- application/json:
15
- schema:
16
- $ref: "#/components/schemas/person"
17
- /nested-object:
7
+ /all-of/employee:
18
8
  get:
19
- tags:
20
- - Test with various data types
21
- summary: Nested object
22
- description: Response schema is made up of multiple nested object, For simple schema check out [simple object](#get-/simple-object)
9
+ summary: List of employees
23
10
  responses:
24
- '200':
25
- description: successful operation
11
+ "200":
26
12
  content:
27
13
  application/json:
28
14
  schema:
29
15
  type: object
30
- description: Description of **Person** object (Person must be bold)
31
- properties:
32
- age:
33
- description: Person's **Age** (age must be bold)
34
- type: integer
35
- fullName:
36
- description: Person's Full name
37
- type: object
38
- properties:
39
- firstName:
40
- description: _First name_ (First name should be italics)
41
- type: string
42
- lastName:
43
- description: |
44
- `Last name` (last name must be monospaced)
45
- type: string
46
- dependentIds:
47
- type: array
48
- description: IDs of Dependents .
49
- items:
50
- type: integer
51
- dependentNames:
52
- type: array
53
- description: Full Name of **Dependents** (Dependents must be bold).
54
- items:
55
- type: object
56
- properties:
57
- firstNameParts:
58
- description: Parts of **First Name** (First Name must be bold)
59
- type: object
60
- properties:
61
- firstName:
62
- description: This is a very very long description to test how will it show up on a API spec renderer tool such as RapiDoc. This lable must be big enough to wrap into next line
63
- type: string
64
- aLongFieldForTestingHowItShowsUpInSchemaModelWhenItEncountersLongField:
65
- description: Dependent Last Name
66
- type: string
67
- dependentLastName:
68
- description: Dependent Last Name
69
- type: string
70
- hobbies:
71
- type: array
72
- description: array of objects
73
- items:
74
- type: object
75
-
76
- /simple-object:
77
- get:
78
- tags:
79
- - Test with various data types
80
- summary: Simple object
81
- description: Response schema is a simple object, which contains only primitive properties. For complex schema check out [nested object](#get-/nested-object)
82
- responses:
83
- '200':
84
- description: successful operation
85
- content:
86
- application/json:
87
- schema:
88
- type: object
89
- properties:
90
- name:
91
- description: Person Name
92
- type: string
93
- age:
94
- description: Person Age
95
- type: integer
96
- minimum: 1
97
- maximum: 100
98
-
99
-
100
- /person:
101
- post:
102
- tags:
103
- - Test with various data types
104
- summary: Data Types with constraints
105
- description: Request-Parameters and Response-Schema contains various data types and constrains. Check out how is it desplayed below
106
- parameters:
107
- - name: height
108
- in: query
109
- description: height (in inches)
110
- required: true
111
- example: 70
112
- schema:
113
- type: integer
114
- format: int32
115
- minimum: 12
116
- maximum: 120
117
- - name: full-name
118
- in: query
119
- description: Name of a person
120
- required: true
121
- schema:
122
- type: string
123
- minimum: 3
124
- - name: social-connection
125
- in: query
126
- description: facebook, linkedin, github, instagram, twitter etc
127
- schema:
128
- type: string
129
- format: url
130
- - name: email
131
- in: query
132
- required: true
133
- schema:
134
- type: string
135
- format: email
136
- - name: email-password
137
- in: query
138
- required: true
139
- schema:
140
- type: string
141
- format: password
142
- - name: date-of-birth
143
- in: query
144
- required: true
145
- schema:
146
- type: string
147
- format: date
148
- - name: phone
149
- in: query
150
- schema:
151
- type: string
152
- pattern: '/^\+(?:[0-9]-?){6,14}[0-9]$/'
153
- - name: marital-status
154
- in: query
155
- required: true
156
- example: married
157
- schema:
158
- type: string
159
- enum:
160
- - married
161
- - unmarried
162
- - widowed
163
- - unknown
164
- default: unknown
165
- - name: interests
166
- in: query
167
- required: true
168
- description: __Exploded Array__ will send separate querystring parameter for each items eg - `interests=computers&interests=movies`
169
- schema:
170
- type: array
171
- example:
172
- - computers
173
- - reading
174
- - ['music', 'movies']
175
- minItems: 1
176
- maxItems: 3
177
- items:
178
- type: string
179
- enum:
180
- - computers
181
- - hiking
182
- - swiming
183
- - movies
184
- - music
185
- - dancing
186
- - reading
187
- - painting
188
- default: hiking
189
- - name: tags
190
- in: query
191
- description: __Not Exploded Array__ will send a single querystring parameter with comma separated string eg - `tags=tall,dark,handsome`
192
- style: form
193
- explode: false
194
- schema:
195
- type: array
196
- items:
197
- type: string
198
- responses:
199
- '200':
200
- description: successful operation
201
- content:
202
- application/json:
203
- schema:
204
- type: array
205
- items:
206
- $ref: '#/components/schemas/person'
16
+ $ref: "#/components/schemas/person"
207
17
  components:
18
+ securitySchemes:
19
+ JWT:
20
+ type: http
21
+ scheme: bearer
22
+ bearerFormat: JWT
23
+ ApiKey:
24
+ type: apiKey
25
+ in: header
26
+ name: API_TOKEN
208
27
  schemas:
209
- category:
210
- type: object
211
- properties:
212
- catId:
213
- description: Category ID
214
- allOf:
215
- - $ref: '#/components/schemas/id'
216
- name:
217
- description: Category name
218
- type: string
219
- deprecated: true
220
- id:
221
- type: string
222
- format: uuid
223
- readOnly: true
224
28
  person:
225
29
  type: object
226
30
  required:
227
- - name
228
- - photoUrls
229
- properties:
230
- id:
231
- description: Pet ID
232
- allOf:
233
- - $ref: '#/components/schemas/id'
234
- category:
235
- description: Categories this person belongs to
236
- allOf:
237
- - $ref: '#/components/schemas/category'
238
- country:
239
- type: object
240
- deprecated: true
241
- properties:
242
- countryCode:
243
- type: string
244
- countryName:
245
- type: string
246
- dependentIds:
247
- type: array
248
- deprecated: true
249
- description: IDs of Dependents .
250
- items:
251
- type: integer
252
- example:
253
- - 278
254
- - 279
255
- - 280
256
- - 281
257
- name:
258
- description: Name of the person
259
- type: string
260
- minLength: 4
261
- example: Guru
262
- photoUrls:
263
- description: The list of URL to a cute photos featuring pet
264
- type: array
265
- maxItems: 20
266
- items:
31
+ - prop1
32
+ anyOf:
33
+ - properties:
34
+ prop1:
267
35
  type: string
268
- format: url
269
- tags:
270
- description: Tags attached to the pet
271
- type: array
272
- minItems: 1
273
- items:
274
- $ref: '#/components/schemas/tag'
275
- maritalStatus:
276
- type: string
277
- description: Marital status in case of adult
278
- enum:
279
- - married
280
- - unmarried
281
- - widowed
282
- phone:
283
- description: phone number in international format
284
- type: string
285
- pattern: '/^\+(?:[0-9]-?){6,14}[0-9]$/'
286
- example: 123
287
- nullable: true
288
- tag:
289
- type: object
290
- properties:
291
- id:
292
- description: Tag ID
293
- allOf:
294
- - $ref: '#/components/schemas/id'
295
- name:
296
- description: Tag name
297
- type: string
298
- minLength: 1
36
+ description: Employee ID
package/docs/welcome.html CHANGED
@@ -15,8 +15,8 @@
15
15
  <meta charset="utf-8">
16
16
  <meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes">
17
17
  <meta name="description" content="RapiDoc is Web Component for viewing Swagger & OpenAPI Spec. Supports themes, styling and various rendering styles">
18
- <meta name="keywords" content="API, RapiDoc, ReDoc, Swagger, SwaggerUI, Custom Element, async-api, Web Component, web-hooks, OpenAPI, REST, themes, dark mode, markdown, API documentation, open api console, API mock">
19
-
18
+ <meta name="keywords" content="RapiDoc, openapi viewer, openapi to html, openapi renderer, ReDoc, Swagger, SwaggerUI, Custom Element, Web Component, OpenAPI, REST, themes, dark mode, markdown, API documentation, API mock">
19
+
20
20
  <link rel="shortcut icon" type="image/png" href="./images/logo.png"/>
21
21
 
22
22
  <!-- Fonts -->
@@ -267,7 +267,7 @@
267
267
  <pre class="shadow code-block"><code class="html" style="border-radius:4px">&lt;!doctype html&gt; &lt;!-- Important: must specify --&gt;
268
268
  &lt;html&gt;
269
269
  &lt;head&gt;
270
- &lt;meta charset="utf-8"&gt; &lt;!-- Important: rapi-doc uses utf8 charecters --&gt;
270
+ &lt;meta charset="utf-8"&gt; &lt;!-- Important: rapi-doc uses utf8 characters --&gt;
271
271
  &lt;script type="module" src="https://unpkg.com/rapidoc/dist/rapidoc-min.js"&gt;&lt;/script&gt;
272
272
  &lt;/head&gt;
273
273
  &lt;body&gt;
package/index.html CHANGED
@@ -30,20 +30,25 @@
30
30
  ./specs/oneof1.yaml <<< nested oneof
31
31
  -->
32
32
  <rapi-doc
33
- spec-url = "./specs/petstore.yaml"
33
+ spec-url = "./specs/temp.yaml"
34
34
  id="thedoc"
35
35
  theme = "dark"
36
36
  render-style="read"
37
37
  schema-style="tree"
38
+ use-path-in-nav-bar="true"
38
39
  show-components = "true"
39
40
  show-info = "true"
40
- show-header = "false"
41
- allow-search = "true"
42
- allow-advanced-search = "false"
43
- allow-server-selection = "false"
44
- allow-authentication = "false"
41
+ show-header = "true"
42
+ allow-search = "false"
43
+ allow-advanced-search = "true"
44
+ allow-spec-url-load="false"
45
+ allow-spec-file-load="false"
46
+ allow-spec-file-download="true"
47
+ allow-server-selection = "true"
48
+ allow-authentication = "true"
45
49
  update-route="false"
46
50
  match-type="regex"
51
+ persist-auth="true"
47
52
  ></rapi-doc>
48
53
  <!--
49
54
  <rapi-doc-mini
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rapidoc",
3
- "version": "9.1.0",
3
+ "version": "9.1.4",
4
4
  "description": "RapiDoc - Open API spec viewer with built in console",
5
5
  "author": "Mrinmoy Majumdar <mrin9@yahoo.com>",
6
6
  "repository": {
@@ -29,12 +29,13 @@
29
29
  "module": "dist/rapidoc-min.js",
30
30
  "mode": "production",
31
31
  "dependencies": {
32
- "@apitools/openapi-parser": "^0.0.9",
32
+ "@apitools/openapi-parser": "^0.0.10",
33
33
  "base64-arraybuffer": "^1.0.1",
34
+ "buffer": "^6.0.3",
34
35
  "lit-element": "2.5.1",
35
36
  "lit-html": "1.4.1",
36
- "marked": "^3.0.4",
37
- "prismjs": "^1.25.0"
37
+ "marked": "^4.0.10",
38
+ "prismjs": "^1.26.0"
38
39
  },
39
40
  "scripts": {
40
41
  "build": "NODE_ENV=production webpack --mode=production",
@@ -46,30 +47,30 @@
46
47
  "lint-fix": "./node_modules/eslint/bin/eslint.js --fix ./src/**"
47
48
  },
48
49
  "devDependencies": {
49
- "@babel/core": "^7.15.5",
50
- "@babel/eslint-parser": "^7.15.4",
51
- "@babel/preset-env": "^7.15.6",
52
- "babel-loader": "^8.2.2",
50
+ "@babel/core": "^7.16.7",
51
+ "@babel/eslint-parser": "^7.16.5",
52
+ "@babel/preset-env": "^7.16.8",
53
+ "babel-loader": "^8.2.3",
53
54
  "babel-plugin-template-html-minifier": "^4.1.0",
54
55
  "clean-webpack-plugin": "^4.0.0",
55
- "compression-webpack-plugin": "^9.0.0",
56
- "css-loader": "^6.2.0",
56
+ "compression-webpack-plugin": "^9.2.0",
57
+ "css-loader": "^6.5.1",
57
58
  "eslint": "^7.32.0",
58
- "eslint-config-airbnb": "^18.2.1",
59
- "eslint-import-resolver-webpack": "^0.13.1",
59
+ "eslint-config-airbnb": "^19.0.4",
60
+ "eslint-import-resolver-webpack": "^0.13.2",
60
61
  "eslint-loader": "^4.0.2",
61
- "eslint-plugin-import": "^2.24.2",
62
- "eslint-webpack-plugin": "3.0.1",
62
+ "eslint-plugin-import": "^2.25.4",
63
+ "eslint-webpack-plugin": "3.1.1",
63
64
  "file-loader": "^6.2.0",
64
65
  "filemanager-webpack-plugin": "^6.1.7",
65
- "html-webpack-plugin": "^5.3.2",
66
+ "html-webpack-plugin": "^5.5.0",
66
67
  "inspectpack": "^4.7.1",
67
- "style-loader": "^3.2.1",
68
- "terser-webpack-plugin": "^5.2.4",
69
- "webpack": "^5.53.0",
70
- "webpack-bundle-analyzer": "^4.4.2",
71
- "webpack-cli": "^4.8.0",
72
- "webpack-dev-server": "^4.2.1"
68
+ "style-loader": "^3.3.1",
69
+ "terser-webpack-plugin": "^5.3.0",
70
+ "webpack": "^5.66.0",
71
+ "webpack-bundle-analyzer": "^4.5.0",
72
+ "webpack-cli": "^4.9.1",
73
+ "webpack-dev-server": "^4.7.3"
73
74
  },
74
75
  "engines": {
75
76
  "node": ">=10.21.0"