rapidoc 9.1.3 → 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 (52) hide show
  1. package/dist/index.html +1 -1
  2. package/dist/index.html.gz +0 -0
  3. package/dist/rapidoc-min.js +2 -2
  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 +12 -5
  10. package/docs/examples/dynamic-query-params.html +1 -0
  11. package/docs/examples/readwrite.html +40 -0
  12. package/docs/examples.html +3 -2
  13. package/docs/index.html +2 -2
  14. package/docs/list.html +6 -2
  15. package/docs/quickstart.html +1 -1
  16. package/docs/rapidoc-min.js +2 -2
  17. package/docs/specs/code-highlight.yaml +1 -1
  18. package/docs/specs/data-types.yaml +0 -1
  19. package/docs/specs/examples.yaml +11 -0
  20. package/docs/specs/petstore_extended.yaml +1 -1
  21. package/docs/specs/readwrite.yaml +90 -0
  22. package/docs/specs/temp.json +24 -105
  23. package/docs/specs/temp.yaml +20 -282
  24. package/docs/welcome.html +3 -3
  25. package/index.html +8 -5
  26. package/package.json +22 -21
  27. package/src/components/api-request.js +78 -41
  28. package/src/components/api-response.js +10 -10
  29. package/src/components/schema-table.js +51 -14
  30. package/src/components/schema-tree.js +59 -18
  31. package/src/components/tag-input.js +8 -1
  32. package/src/json-schema-viewer.js +1 -1
  33. package/src/rapidoc-mini.js +5 -1
  34. package/src/rapidoc.js +5 -1
  35. package/src/styles/font-styles.js +3 -2
  36. package/src/styles/nav-styles.js +2 -2
  37. package/src/templates/components-template.js +5 -5
  38. package/src/templates/endpoint-template.js +1 -1
  39. package/src/templates/expanded-endpoint-template.js +1 -1
  40. package/src/templates/focused-endpoint-template.js +1 -1
  41. package/src/templates/header-template.js +1 -1
  42. package/src/templates/json-schema-viewer-template.js +8 -8
  43. package/src/templates/main-body-template.js +4 -1
  44. package/src/templates/navbar-template.js +2 -2
  45. package/src/templates/overview-template.js +5 -2
  46. package/src/templates/security-scheme-template.js +48 -13
  47. package/src/templates/server-template.js +1 -1
  48. package/src/utils/common-utils.js +2 -1
  49. package/src/utils/schema-utils.js +14 -9
  50. package/src/utils/spec-parser.js +3 -3
  51. package/webpack.config.js +1 -0
  52. package/docs/specs/tenants.json +0 -12
package/docker/Dockerfile CHANGED
@@ -1,3 +1,6 @@
1
+ # to Build the Docker image from root folder execute
2
+ # docker build -t mrin9/rapidoc -f ./docker/Dockerfile .
3
+
1
4
  # Run the Docker image (view a spec thats hosted on a web-server)
2
5
  # docker run -it --rm -p 80:80 -e SPEC_URL="http://petstore.swagger.io/v2/swagger.json" mrin9/rapidoc
3
6
 
@@ -30,17 +33,14 @@ RUN npm run build
30
33
 
31
34
  # production stage
32
35
  FROM nginx:stable-alpine as production-stage
33
- COPY --from=build-stage /app/dist /app
34
- COPY ./nginx/nginx.conf /etc/nginx/nginx.conf
35
36
 
36
37
  ENV PAGE_TITLE="RapiDoc"
37
38
  ENV PAGE_FAVICON="favicon.png"
38
39
  ENV SPEC_URL="http://petstore.swagger.io/v2/swagger.json"
39
40
  ENV PORT=80
40
- ENV RAPIDOC_OPTIONS=
41
41
 
42
42
  # copy files to the nginx folder
43
- COPY --from=0 build/dist /usr/share/nginx/html
43
+ COPY --from=build-stage /app/dist /usr/share/nginx/html
44
44
  COPY docker/index.tpl.html /usr/share/nginx/html/index.html
45
45
  COPY logo.png /usr/share/nginx/html/favicon.png
46
46
  COPY docker/nginx.conf /etc/nginx/
@@ -48,4 +48,4 @@ COPY docker/docker-run.sh /usr/local/bin
48
48
 
49
49
  EXPOSE 80
50
50
 
51
- CMD ["sh", "/usr/local/bin/docker-run.sh"]
51
+ CMD ["sh", "/usr/local/bin/docker-run.sh"]
package/docs/api.html CHANGED
@@ -14,8 +14,8 @@
14
14
 
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
- <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="RapiDoc, ReDoc, Swagger, SwaggerUI, Custom Element, Web Component, OpenAPI,REST, themes, dark mode, markdown, API documentation">
17
+ <meta name="description" content="RapiDoc is a Web Component for viewing Swagger & OpenAPI Spec. Supports themes, styling and various rendering styles">
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">
19
19
 
20
20
  <link rel="shortcut icon" type="image/png" href="./images/logo.png"/>
21
21
 
@@ -147,6 +147,13 @@
147
147
  </span> Request fields will be filled with example value (if provided in spec) </td>
148
148
  <td class='default-col'>true</td>
149
149
  </tr>
150
+
151
+ <tr>
152
+ <td class="attr-col mono bold right">persist-auth </td>
153
+ <td class="gray"><span class='bold dark-gray'>Allowed:<span class='blue'> true | false </span>
154
+ </span> Authentication will be persisted to localStorage </td>
155
+ <td class='default-col'>false</td>
156
+ </tr>
150
157
  </table>
151
158
 
152
159
  <a id="att-colors"></a>
@@ -352,7 +359,7 @@
352
359
  <tr>
353
360
  <td class="mono bold right">schema-hide-read-only </td>
354
361
  <td class="gray"> <span class='bold dark-gray'>Allowed:<span class='blue'> always | never | (combination of: post | put | patch)</span></span> -
355
- read-only fileds in request schemas is <span class='blue'> always </span> hidden but are shown in response.
362
+ read-only fields in request schemas is <span class='blue'> always </span> hidden but are shown in response.
356
363
  <br/>
357
364
  If you do not want to hide read-only fields or hide them based on action you can configure this setting to 'never' or any combination of post | put | patch to indicate where to hide
358
365
  <br/>
@@ -364,7 +371,7 @@
364
371
  <tr>
365
372
  <td class="mono bold right">schema-hide-write-only </td>
366
373
  <td class="gray"> <span class='bold dark-gray'>Allowed:<span class='blue'> always | never</span></span> -
367
- write-only fileds in response schemas is <span class='blue'> always </span> hidden but are shown in request.
374
+ write-only fields in response schemas is <span class='blue'> always </span> hidden but are shown in request.
368
375
  <br/>
369
376
  If you do not want to hide write-only fields then set to 'never'
370
377
  <br/>
@@ -797,7 +804,7 @@
797
804
  <tr>
798
805
  <td class="mono bold right">{method}-{path}</td>
799
806
  <td class="gray"> each path is identified by an id. which is in the format of {method}-{path},
800
- and certain invalid charecters such as {, }, #, space is replaced by hyphen (-).
807
+ and certain invalid characters such as {, }, #, space is replaced by hyphen (-).
801
808
  Use this slot to insert HTML content into a specifi tag
802
809
  </td>
803
810
  </tr>
@@ -29,6 +29,7 @@
29
29
  show-header = "false"
30
30
  regular-font = 'Open Sans'
31
31
  mono-font = "Roboto Mono"
32
+ default-schema-tab = "example"
32
33
  > </rapi-doc>
33
34
  </body>
34
35
  </html>
@@ -0,0 +1,40 @@
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <!-- Global site tag (gtag.js) - Google Analytics -->
5
+ <script async src='https://www.googletagmanager.com/gtag/js?id=UA-132775238-1'></script>
6
+ <script>
7
+ window.dataLayer = window.dataLayer || [];
8
+ function gtag(){dataLayer.push(arguments);}
9
+ gtag('js', new Date());
10
+ gtag('config', 'UA-132775238-1');
11
+ </script>
12
+ <meta charset='utf-8'>
13
+ <meta name='viewport' content='width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes'>
14
+ <link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;600&family=Roboto+Mono&display=swap" rel="stylesheet">
15
+ <link href='../index.css' rel='stylesheet'>
16
+ <script type='module' src='../rapidoc-min.js'></script>
17
+ </head>
18
+ <body>
19
+ <rapi-doc spec-url="../specs/readwrite.yaml"
20
+ id = "thedoc"
21
+ allow-authentication = "false"
22
+ allow-search = "false"
23
+ show-info = "false"
24
+ show-header = "false"
25
+ render-style = "read"
26
+ allow-try = "false"
27
+ regular-font = 'Open Sans'
28
+ mono-font = "Roboto Mono"
29
+ theme = "dark"
30
+ schema-style='tree'
31
+ >
32
+ <div slot="nav-logo" style="width:100%; display: flex; flex-direction:column;">
33
+ <div style="display: flex;justify-content: center; margin: 2px 0">
34
+ <button class='btn medium' onclick="document.getElementById('thedoc').setAttribute('schema-style', 'tree')" >Tree</button>
35
+ <button class='btn medium' onclick="document.getElementById('thedoc').setAttribute('schema-style', 'table')" >Table</button>
36
+ </div>
37
+ </div>
38
+ </rapi-doc>
39
+ </body>
40
+ </html>
@@ -77,7 +77,7 @@
77
77
  &lt;!doctype html&gt; &lt;!-- Important: must specify --&gt;
78
78
  &lt;html&gt;
79
79
  &lt;head&gt;
80
- &lt;meta charset="utf-8"&gt; &lt;!-- Important: rapi-doc uses utf8 charecters --&gt;
80
+ &lt;meta charset="utf-8"&gt; &lt;!-- Important: rapi-doc uses utf8 characters --&gt;
81
81
  &lt;script type="module" src="https://unpkg.com/rapidoc/dist/rapidoc-min.js"&gt;&lt;/script&gt;
82
82
  &lt;/head&gt;
83
83
  &lt;body&gt;
@@ -188,7 +188,8 @@
188
188
  &lt;img
189
189
  slot="nav-logo"
190
190
  src="https://img.icons8.com/color/48/000000/youtube-play.png"
191
- /&gt;
191
+ /&gt;
192
+ /&gt;
192
193
  &lt;/rapi-doc&gt;
193
194
  </code>
194
195
  </pre>
package/docs/index.html CHANGED
@@ -15,7 +15,7 @@
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, stoplight, readme, Swagger, SwaggerUI, Custom Element, async-api, Web Component, web-hooks, OpenAPI, REST, themes, dark mode, markdown, API documentation, open api console, API mock, rest documentation">
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
19
 
20
20
  <link rel="shortcut icon" type="image/png" href="./images/logo.png"/>
21
21
 
@@ -267,7 +267,7 @@
267
267
  &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/docs/list.html CHANGED
@@ -14,7 +14,7 @@
14
14
  <meta charset="utf-8">
15
15
  <meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes">
16
16
  <meta name="description" content="RapiDoc is Web Component for viewing Swagger & OpenAPI Spec. Supports themes, styling and various rendering styles">
17
- <meta name="keywords" content="RapiDoc, ReDoc, Swagger, SwaggerUI, Custom Element, async-api, Web Component, web-hooks, OpenAPI, REST, themes, dark mode, markdown, API documentation">
17
+ <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">
18
18
 
19
19
  <link rel="shortcut icon" type="image/png" href="./images/logo.png"/>
20
20
 
@@ -509,7 +509,11 @@
509
509
  <tr><td class="mono-bold">
510
510
  <a href="./examples/data-types.html"> Data types </a>
511
511
  </td></tr>
512
-
512
+
513
+ <tr><td class="mono-bold">
514
+ <a href="./examples/readwrite.html"> Read and Write annotations </a>
515
+ </td></tr>
516
+
513
517
  <tr><td class="mono-bold">
514
518
  <a href="./examples/example-with-nested-refs.html"> Provide Examples with nested refs </a>
515
519
  </td></tr>
@@ -87,7 +87,7 @@
87
87
  &lt;!doctype html&gt; &lt;!-- Important: must specify --&gt;
88
88
  &lt;html&gt;
89
89
  &lt;head&gt;
90
- &lt;meta charset="utf-8"&gt; &lt;!-- Important: rapi-doc uses utf8 charecters --&gt;
90
+ &lt;meta charset="utf-8"&gt; &lt;!-- Important: rapi-doc uses utf8 characters --&gt;
91
91
  &lt;script type="module" src="https://unpkg.com/rapidoc/dist/rapidoc-min.js"&gt;&lt;/script&gt;
92
92
  &lt;/head&gt;
93
93
  &lt;body&gt;