[ofbiz-plugins] branch trunk updated: Improved: Changed webapp name for API docs to 'docs' and add redoc.html for rendering OpenAPI spec using Redoc(OFBIZ-11328)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ofbiz-plugins] branch trunk updated: Improved: Changed webapp name for API docs to 'docs' and add redoc.html for rendering OpenAPI spec using Redoc(OFBIZ-11328)

grv-2
This is an automated email from the ASF dual-hosted git repository.

grv pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-plugins.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 8a430c4  Improved: Changed webapp name for API docs to 'docs' and add redoc.html for rendering OpenAPI spec using Redoc(OFBIZ-11328)
8a430c4 is described below

commit 8a430c48a13a6361bdb6eba608bc93a3ab872413
Author: Girish Vasmatkar <[hidden email]>
AuthorDate: Sat Oct 24 18:45:02 2020 +0530

    Improved: Changed webapp name for API docs to 'docs' and add redoc.html for rendering OpenAPI spec using Redoc(OFBIZ-11328)
---
 ofbiz-rest-impl/ofbiz-component.xml                |   6 ++---
 .../webapp/{swagger => docs}/WEB-INF/web.xml       |   0
 .../webapp/{swagger => docs}/favicon-16x16.png     | Bin
 .../webapp/{swagger => docs}/favicon-32x32.png     | Bin
 .../webapp/{swagger => docs}/oauth2-redirect.html  |   0
 ofbiz-rest-impl/webapp/docs/redoc.html             |  29 +++++++++++++++++++++
 .../webapp/{swagger => docs}/swagger-ui-bundle.js  |   0
 .../{swagger => docs}/swagger-ui-bundle.js.map     |   0
 .../{swagger => docs}/swagger-ui-es-bundle-core.js |   0
 .../swagger-ui-es-bundle-core.js.map               |   0
 .../{swagger => docs}/swagger-ui-es-bundle.js      |   0
 .../{swagger => docs}/swagger-ui-es-bundle.js.map  |   0
 .../swagger-ui-standalone-preset.js                |   0
 .../swagger-ui-standalone-preset.js.map            |   0
 .../webapp/{swagger => docs}/swagger-ui.css        |   0
 .../webapp/{swagger => docs}/swagger-ui.css.map    |   0
 .../webapp/{swagger => docs}/swagger-ui.html       |   0
 .../webapp/{swagger => docs}/swagger-ui.js         |   0
 .../webapp/{swagger => docs}/swagger-ui.js.map     |   0
 19 files changed, 32 insertions(+), 3 deletions(-)

diff --git a/ofbiz-rest-impl/ofbiz-component.xml b/ofbiz-rest-impl/ofbiz-component.xml
index c1aa1da..2790b61 100644
--- a/ofbiz-rest-impl/ofbiz-component.xml
+++ b/ofbiz-rest-impl/ofbiz-component.xml
@@ -52,10 +52,10 @@ under the License.
             location="webapp/ofbiz-rest-jersey"
             base-permission="OFBTOOLS,OFBIZ-REST-JERSEY"
             mount-point="/rest"/>
-    <webapp name="swagger"
-            title="Swagger Docs"
+    <webapp name="api-docs"
+            title="REST API Docs"
             app-bar-display="false"
             server="default-server"
-            location="webapp/swagger"
+            location="webapp/docs"
             mount-point="/docs"/>
 </ofbiz-component>
diff --git a/ofbiz-rest-impl/webapp/swagger/WEB-INF/web.xml b/ofbiz-rest-impl/webapp/docs/WEB-INF/web.xml
similarity index 100%
rename from ofbiz-rest-impl/webapp/swagger/WEB-INF/web.xml
rename to ofbiz-rest-impl/webapp/docs/WEB-INF/web.xml
diff --git a/ofbiz-rest-impl/webapp/swagger/favicon-16x16.png b/ofbiz-rest-impl/webapp/docs/favicon-16x16.png
similarity index 100%
rename from ofbiz-rest-impl/webapp/swagger/favicon-16x16.png
rename to ofbiz-rest-impl/webapp/docs/favicon-16x16.png
diff --git a/ofbiz-rest-impl/webapp/swagger/favicon-32x32.png b/ofbiz-rest-impl/webapp/docs/favicon-32x32.png
similarity index 100%
rename from ofbiz-rest-impl/webapp/swagger/favicon-32x32.png
rename to ofbiz-rest-impl/webapp/docs/favicon-32x32.png
diff --git a/ofbiz-rest-impl/webapp/swagger/oauth2-redirect.html b/ofbiz-rest-impl/webapp/docs/oauth2-redirect.html
similarity index 100%
rename from ofbiz-rest-impl/webapp/swagger/oauth2-redirect.html
rename to ofbiz-rest-impl/webapp/docs/oauth2-redirect.html
diff --git a/ofbiz-rest-impl/webapp/docs/redoc.html b/ofbiz-rest-impl/webapp/docs/redoc.html
new file mode 100644
index 0000000..8bbcdac
--- /dev/null
+++ b/ofbiz-rest-impl/webapp/docs/redoc.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <title>OFBiz REST API</title>
+    <!-- needed for adaptive design -->
+    <meta charset="utf-8"/>
+    <meta name="viewport" content="width=device-width, initial-scale=1">
+    <link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,700|Roboto:300,400,700" rel="stylesheet">
+    <!--
+    ReDoc doesn't change outer page styles
+    -->
+    <style>
+      body {
+        margin: 0;
+        padding: 0;
+      }
+    </style>
+  </head>
+  <body>
+  <redoc></redoc>
+  <script src="https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js"> </script>
+  <script>
+      if (!window.location.origin) {
+        window.location.origin = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port : '');
+      }
+      Redoc.init(window.location.origin + '/rest/openapi.json');
+    </script>
+  </body>
+</html>
diff --git a/ofbiz-rest-impl/webapp/swagger/swagger-ui-bundle.js b/ofbiz-rest-impl/webapp/docs/swagger-ui-bundle.js
similarity index 100%
rename from ofbiz-rest-impl/webapp/swagger/swagger-ui-bundle.js
rename to ofbiz-rest-impl/webapp/docs/swagger-ui-bundle.js
diff --git a/ofbiz-rest-impl/webapp/swagger/swagger-ui-bundle.js.map b/ofbiz-rest-impl/webapp/docs/swagger-ui-bundle.js.map
similarity index 100%
rename from ofbiz-rest-impl/webapp/swagger/swagger-ui-bundle.js.map
rename to ofbiz-rest-impl/webapp/docs/swagger-ui-bundle.js.map
diff --git a/ofbiz-rest-impl/webapp/swagger/swagger-ui-es-bundle-core.js b/ofbiz-rest-impl/webapp/docs/swagger-ui-es-bundle-core.js
similarity index 100%
rename from ofbiz-rest-impl/webapp/swagger/swagger-ui-es-bundle-core.js
rename to ofbiz-rest-impl/webapp/docs/swagger-ui-es-bundle-core.js
diff --git a/ofbiz-rest-impl/webapp/swagger/swagger-ui-es-bundle-core.js.map b/ofbiz-rest-impl/webapp/docs/swagger-ui-es-bundle-core.js.map
similarity index 100%
rename from ofbiz-rest-impl/webapp/swagger/swagger-ui-es-bundle-core.js.map
rename to ofbiz-rest-impl/webapp/docs/swagger-ui-es-bundle-core.js.map
diff --git a/ofbiz-rest-impl/webapp/swagger/swagger-ui-es-bundle.js b/ofbiz-rest-impl/webapp/docs/swagger-ui-es-bundle.js
similarity index 100%
rename from ofbiz-rest-impl/webapp/swagger/swagger-ui-es-bundle.js
rename to ofbiz-rest-impl/webapp/docs/swagger-ui-es-bundle.js
diff --git a/ofbiz-rest-impl/webapp/swagger/swagger-ui-es-bundle.js.map b/ofbiz-rest-impl/webapp/docs/swagger-ui-es-bundle.js.map
similarity index 100%
rename from ofbiz-rest-impl/webapp/swagger/swagger-ui-es-bundle.js.map
rename to ofbiz-rest-impl/webapp/docs/swagger-ui-es-bundle.js.map
diff --git a/ofbiz-rest-impl/webapp/swagger/swagger-ui-standalone-preset.js b/ofbiz-rest-impl/webapp/docs/swagger-ui-standalone-preset.js
similarity index 100%
rename from ofbiz-rest-impl/webapp/swagger/swagger-ui-standalone-preset.js
rename to ofbiz-rest-impl/webapp/docs/swagger-ui-standalone-preset.js
diff --git a/ofbiz-rest-impl/webapp/swagger/swagger-ui-standalone-preset.js.map b/ofbiz-rest-impl/webapp/docs/swagger-ui-standalone-preset.js.map
similarity index 100%
rename from ofbiz-rest-impl/webapp/swagger/swagger-ui-standalone-preset.js.map
rename to ofbiz-rest-impl/webapp/docs/swagger-ui-standalone-preset.js.map
diff --git a/ofbiz-rest-impl/webapp/swagger/swagger-ui.css b/ofbiz-rest-impl/webapp/docs/swagger-ui.css
similarity index 100%
rename from ofbiz-rest-impl/webapp/swagger/swagger-ui.css
rename to ofbiz-rest-impl/webapp/docs/swagger-ui.css
diff --git a/ofbiz-rest-impl/webapp/swagger/swagger-ui.css.map b/ofbiz-rest-impl/webapp/docs/swagger-ui.css.map
similarity index 100%
rename from ofbiz-rest-impl/webapp/swagger/swagger-ui.css.map
rename to ofbiz-rest-impl/webapp/docs/swagger-ui.css.map
diff --git a/ofbiz-rest-impl/webapp/swagger/swagger-ui.html b/ofbiz-rest-impl/webapp/docs/swagger-ui.html
similarity index 100%
rename from ofbiz-rest-impl/webapp/swagger/swagger-ui.html
rename to ofbiz-rest-impl/webapp/docs/swagger-ui.html
diff --git a/ofbiz-rest-impl/webapp/swagger/swagger-ui.js b/ofbiz-rest-impl/webapp/docs/swagger-ui.js
similarity index 100%
rename from ofbiz-rest-impl/webapp/swagger/swagger-ui.js
rename to ofbiz-rest-impl/webapp/docs/swagger-ui.js
diff --git a/ofbiz-rest-impl/webapp/swagger/swagger-ui.js.map b/ofbiz-rest-impl/webapp/docs/swagger-ui.js.map
similarity index 100%
rename from ofbiz-rest-impl/webapp/swagger/swagger-ui.js.map
rename to ofbiz-rest-impl/webapp/docs/swagger-ui.js.map