You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by vo...@apache.org on 2020/07/20 09:53:32 UTC

[fineract] branch develop updated: FINERACT-842 Made TRY-IT swagger button work

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

vorburger pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract.git


The following commit(s) were added to refs/heads/develop by this push:
     new a84edce  FINERACT-842 Made TRY-IT swagger button work
a84edce is described below

commit a84edce73b8e8af34b28ee2cf591e70e0a5b52dd
Author: Manthan Surkar <ma...@gmail.com>
AuthorDate: Thu Jul 16 19:05:24 2020 +0530

    FINERACT-842 Made TRY-IT swagger button work
---
 fineract-provider/build.gradle                     |  4 +--
 .../config/swagger/fineract-input.json             | 16 ----------
 .../config/swagger/fineract-input.yaml             | 37 ++++++++++++++++++++++
 .../main/resources/static/swagger-ui/index.html    | 10 ++++--
 4 files changed, 46 insertions(+), 21 deletions(-)

diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle
index 08b905d..ddc80c2 100644
--- a/fineract-provider/build.gradle
+++ b/fineract-provider/build.gradle
@@ -196,11 +196,11 @@ openjpa {
 resolve {
     logging.captureStandardOutput LogLevel.INFO
     outputFileName = 'fineract'
-    outputFormat = 'JSON'
+    outputFormat = 'YAML'
     prettyPrint = 'TRUE'
     classpath = sourceSets.main.runtimeClasspath
     outputDir = file("${buildDir}/classes/java/main/static/swagger-ui")
-    openApiFile = file("config/swagger/fineract-input.json")
+    openApiFile = file("config/swagger/fineract-input.yaml")
 }
 
 // Configuration for JaCoCo code coverage task
diff --git a/fineract-provider/config/swagger/fineract-input.json b/fineract-provider/config/swagger/fineract-input.json
deleted file mode 100644
index 264ad56..0000000
--- a/fineract-provider/config/swagger/fineract-input.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
-  "openapi" : "3.0.3",
-  "info": {
-    "version": "1.4.0",
-    "title": "Apache Fineract",
-    "description": "Apache Fineract is a secure, multi-tenanted microfinance platform\n\nThe goal of the Apache Fineract API is to empower developers to build apps on top of the Apache Fineract Platform<br>The [reference app](https://cui.fineract.dev) (username: mifos, password: password) works on the same demo tenant as the interactive links in this documentation\n\n- The API is organized around [REST](https://en.wikipedia.org/wiki/Representational_state_transfer)\n- Find out more about [...]
-    "termsOfService": "https://demo.fineract.dev/fineract-provider/api-docs/apiLive.htm",
-    "contact": {
-      "email": "dev@fineract.apache.org"
-    },
-    "license": {
-      "name": "Apache 2.0",
-      "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
-    }
-  }
-}
diff --git a/fineract-provider/config/swagger/fineract-input.yaml b/fineract-provider/config/swagger/fineract-input.yaml
new file mode 100644
index 0000000..5e78370
--- /dev/null
+++ b/fineract-provider/config/swagger/fineract-input.yaml
@@ -0,0 +1,37 @@
+openapi: 3.0.3
+info:
+  version: 1.4.0
+  title: Apache Fineract
+  description: |-
+    Apache Fineract is a secure, multi-tenanted microfinance platform
+
+    The goal of the Apache Fineract API is to empower developers to build apps on top of the Apache Fineract Platform<br>The [reference app](https://cui.fineract.dev) (username: mifos, password: password) works on the same demo tenant as the interactive links in this documentation
+
+    - The API is organized around [REST](https://en.wikipedia.org/wiki/Representational_state_transfer)
+    - Find out more about Apache Fineract [here](/fineract-provider/api-docs/apiLive.htm#top)
+    - You can [Try The API From Your Browser](/fineract-provider/api-docs/apiLive.htm#interact)
+    - The Generic Options are available [here](/fineract-provider/api-docs/apiLive.htm#genopts)
+    - Find out more about [Updating Dates and Numbers](/fineract-provider/api-docs/apiLive.htm#dates_and_numbers)
+    - For the Authentication and the Basic of HTTP and HTTPS refer [here](/fineract-provider/api-docs/apiLive.htm#authentication_overview)
+    - Check about ERROR codes [here](/fineract-provider/api-docs/apiLive.htm#errors)
+
+    Please refer to the [old documentation](/fineract-provider/api-docs/apiLive.htm) for any documentation queries
+  contact:
+    email: dev@fineract.apache.org
+  license:
+    name: Apache 2.0
+    url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
+servers:
+- url: /fineract-provider/api/v1
+components:
+  securitySchemes:
+    basicAuth:
+      type: http
+      scheme: basic
+    tenantid:        
+      type: apiKey
+      in: header       
+      name: fineract-platform-tenantid 
+security:
+  - basicAuth: []
+    tenantid: []
\ No newline at end of file
diff --git a/fineract-provider/src/main/resources/static/swagger-ui/index.html b/fineract-provider/src/main/resources/static/swagger-ui/index.html
index 3408ce2..b5a6fe0 100644
--- a/fineract-provider/src/main/resources/static/swagger-ui/index.html
+++ b/fineract-provider/src/main/resources/static/swagger-ui/index.html
@@ -39,7 +39,7 @@
     window.onload = function() {
       // Begin Swagger UI call region
       const ui = SwaggerUIBundle({
-        url: "fineract.json",
+        url: "fineract.yaml",
         dom_id: '#swagger-ui',
         deepLinking: true,
          filter: '',
@@ -50,11 +50,15 @@
         plugins: [
           SwaggerUIBundle.plugins.DownloadUrl
         ],
-        layout: "BaseLayout"
+        layout: "BaseLayout",
+        onComplete: function() {
+         ui.preauthorizeBasic("basicAuth", "mifos", "password");
+         ui.preauthorizeApiKey("tenantid", "default");
+    } 
       })
       // End Swagger UI call region
-
       window.ui = ui
+
     }
   </script>
   </body>