You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by GitBox <gi...@apache.org> on 2020/07/26 19:57:40 UTC

[GitHub] [fineract] Grandolf49 opened a new pull request #1206: FINERACT-838 Added Swagger Codegen Support

Grandolf49 opened a new pull request #1206:
URL: https://github.com/apache/fineract/pull/1206


   ## Description
   Integrated Swagger Codegen support for automatically generating client code from OpenAPI Specification
   
   ## Checklist
   Please make sure these boxes are checked before submitting your pull request - thanks!
   
   - [x] Commit message starts with the issue number from https://issues.apache.org/jira/projects/FINERACT/. Ex: FINERACT-646 Pockets API.
   
   - [x] Coding conventions at https://cwiki.apache.org/confluence/display/FINERACT/Coding+Conventions have been followed.
   
   - [x] API documentation at fineract-provider/src/main/resources/static/api-docs/apiLive.htm has been updated with details of any API changes.
   
   - [x] Integration tests have been created/updated for verifying the changes made.
   
   - [x] All Integrations tests are passing with the new commits.
   
   - [x] Submission is not a "code dump".  (Large changes can be made "in repository" via a branch.  Ask on the list.)
   
   Our guidelines for code reviews is at https://cwiki.apache.org/confluence/display/FINERACT/Code+Review+Guide
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] vorburger merged pull request #1206: FINERACT-838 Added Swagger Codegen Support

Posted by GitBox <gi...@apache.org>.
vorburger merged pull request #1206:
URL: https://github.com/apache/fineract/pull/1206


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] Grandolf49 commented on a change in pull request #1206: FINERACT-838 Added Swagger Codegen Support

Posted by GitBox <gi...@apache.org>.
Grandolf49 commented on a change in pull request #1206:
URL: https://github.com/apache/fineract/pull/1206#discussion_r460744830



##########
File path: README.md
##########
@@ -263,6 +263,28 @@ API clients (Web UIs, Mobile, etc.)
 * https://github.com/openMF has more related proejcts
 
 
+Generate Apache Fineract API Client
+============
+
+Apache Fineract supports client code generation using [Swagger Codegen](https://github.com/swagger-api/swagger-codegen). Project supports [all clients](https://github.com/swagger-api/swagger-codegen#overview) supported by Swagger Codegen. It uses [OpenAPI Specification Version 3.0.3](https://swagger.io/specification/).
+
+To generate code, execute the following commands:
+
+- **./gradlew build**
+- **./gradlew generateSwaggerCode**
+
+The client code will be generated in the directory **build/swagger-code-fineract**
+
+To build the generated code:
+
+- Navigate to **build/swagger-code-fineract** directory
+- **./gradlew build**
+
+To customize the generated code:
+
+- Open **fineract-provider/config/swagger/config.json**
+- Refer to [this](https://gist.github.com/Grandolf49/2d222c3d1d0b834ad8f02b5fde8b4c14) for available options in config.json

Review comment:
       I spent a lot of time trying to find where they have documented these options. 😅 [This](https://github.com/swagger-api/swagger-codegen/issues/7795) thread was useful but just a workaround.
   
   I also came across [this](https://openapi-generator.tech/docs/generators/java) which seems like the official documentation from the OpenAPI Team. 
   
   I think it's just better to move this to a separate doc. I'll put a link to this in the doc as you suggested




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] vorburger commented on pull request #1206: FINERACT-838 Added Swagger Codegen Support

Posted by GitBox <gi...@apache.org>.
vorburger commented on pull request #1206:
URL: https://github.com/apache/fineract/pull/1206#issuecomment-664181898


   SGTM.
   
   >
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] Grandolf49 commented on pull request #1206: FINERACT-838 Added Swagger Codegen Support

Posted by GitBox <gi...@apache.org>.
Grandolf49 commented on pull request #1206:
URL: https://github.com/apache/fineract/pull/1206#issuecomment-667500531


   Hi @vorburger  Any more changes to be done here?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] vorburger commented on pull request #1206: FINERACT-838 Added Swagger Codegen Support

Posted by GitBox <gi...@apache.org>.
vorburger commented on pull request #1206:
URL: https://github.com/apache/fineract/pull/1206#issuecomment-667529264


   > Hi @vorburger Any more changes to be done here?
   
   Let me merge this as-is, as a first step... I'll raise a follow-up PR for your review to propose changing from Joda to Java time, and comment on FINERACT-838 for possible future next steps.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] vorburger commented on a change in pull request #1206: FINERACT-838 Added Swagger Codegen Support

Posted by GitBox <gi...@apache.org>.
vorburger commented on a change in pull request #1206:
URL: https://github.com/apache/fineract/pull/1206#discussion_r460726953



##########
File path: README.md
##########
@@ -263,6 +263,28 @@ API clients (Web UIs, Mobile, etc.)
 * https://github.com/openMF has more related proejcts
 
 
+Generate Apache Fineract API Client
+============
+
+Apache Fineract supports client code generation using [Swagger Codegen](https://github.com/swagger-api/swagger-codegen). Project supports [all clients](https://github.com/swagger-api/swagger-codegen#overview) supported by Swagger Codegen. It uses [OpenAPI Specification Version 3.0.3](https://swagger.io/specification/).
+
+To generate code, execute the following commands:
+
+- **./gradlew build**
+- **./gradlew generateSwaggerCode**
+
+The client code will be generated in the directory **build/swagger-code-fineract**

Review comment:
       ```suggestion
   The client code will be generated in the directory `build/swagger-code-fineract`.
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] vorburger commented on a change in pull request #1206: FINERACT-838 Added Swagger Codegen Support

Posted by GitBox <gi...@apache.org>.
vorburger commented on a change in pull request #1206:
URL: https://github.com/apache/fineract/pull/1206#discussion_r460727300



##########
File path: README.md
##########
@@ -263,6 +263,28 @@ API clients (Web UIs, Mobile, etc.)
 * https://github.com/openMF has more related proejcts
 
 
+Generate Apache Fineract API Client
+============
+
+Apache Fineract supports client code generation using [Swagger Codegen](https://github.com/swagger-api/swagger-codegen). Project supports [all clients](https://github.com/swagger-api/swagger-codegen#overview) supported by Swagger Codegen. It uses [OpenAPI Specification Version 3.0.3](https://swagger.io/specification/).
+
+To generate code, execute the following commands:
+
+- **./gradlew build**
+- **./gradlew generateSwaggerCode**
+
+The client code will be generated in the directory **build/swagger-code-fineract**
+
+To build the generated code:
+
+- Navigate to **build/swagger-code-fineract** directory

Review comment:
       ```suggestion
   - Navigate to `build/swagger-code-fineract` directory (`cd`)
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] Grandolf49 commented on a change in pull request #1206: FINERACT-838 Added Swagger Codegen Support

Posted by GitBox <gi...@apache.org>.
Grandolf49 commented on a change in pull request #1206:
URL: https://github.com/apache/fineract/pull/1206#discussion_r460725784



##########
File path: README.md
##########
@@ -263,6 +263,28 @@ API clients (Web UIs, Mobile, etc.)
 * https://github.com/openMF has more related proejcts
 
 
+Generate Apache Fineract API Client

Review comment:
       @vorburger Actually, I already added the description in the README.md. 
   But I can definitely create a new file, as you suggested, under `docs/developers/swagger/client.md` and link it with the main README.md




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] vorburger commented on pull request #1206: FINERACT-838 Added Swagger Codegen Support

Posted by GitBox <gi...@apache.org>.
vorburger commented on pull request #1206:
URL: https://github.com/apache/fineract/pull/1206#issuecomment-664192379


   > could you put the description about how to use this which you provided above into the/README.md as part of this PR?
   
   @Grandolf49 actually, how about, similarly to the discussions in FINERACT-742 and FINERACT-834, you put the doc how to use this (which you provided in the comment above into) into... `docs/developers/swagger/client.md`? And then just a add 1 sentence linking to that from [README.md#apache-fineract-platform-api](https://github.com/apache/fineract/blob/develop/README.md#apache-fineract-platform-api) (both as part of this PR). That would be a great start, for more `docs/` to come, hopefully.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] Grandolf49 commented on pull request #1206: FINERACT-838 Added Swagger Codegen Support

Posted by GitBox <gi...@apache.org>.
Grandolf49 commented on pull request #1206:
URL: https://github.com/apache/fineract/pull/1206#issuecomment-664038841


   To generate the code:
   
   1. **./gradlew build**
   2. **./gradlew generateSwaggerCode**
   
   The code will be generated in the directory **build/swagger-code-fineract**
   
   To build the generated code:
   
   1. Navigate to **build/swagger-code-fineract** directory
   2. **./gradlew build**
   
   A Retrofit2 based Java API Client for Fineract will be generated in build/swagger-code-fineract/build
   
   To customize the generated code:
   
   1. Navigate to [fineract-provider/config/swagger/config.json](https://github.com/Grandolf49/fineract/blob/swagger-codegen/fineract-provider/config/swagger/config.json)
   2. Refer to [this](https://gist.github.com/Grandolf49/2d222c3d1d0b834ad8f02b5fde8b4c14) for available options in config.json


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] vorburger commented on a change in pull request #1206: FINERACT-838 Added Swagger Codegen Support

Posted by GitBox <gi...@apache.org>.
vorburger commented on a change in pull request #1206:
URL: https://github.com/apache/fineract/pull/1206#discussion_r460729842



##########
File path: fineract-provider/config/swagger/config.json
##########
@@ -0,0 +1,11 @@
+{
+   "groupId": "org.apache.fineract",
+   "artifactId": "client",
+   "artifactVersion": "1.0.0",

Review comment:
       ```suggestion
      "artifactVersion": "1.4.0",
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] Grandolf49 commented on a change in pull request #1206: FINERACT-838 Added Swagger Codegen Support

Posted by GitBox <gi...@apache.org>.
Grandolf49 commented on a change in pull request #1206:
URL: https://github.com/apache/fineract/pull/1206#discussion_r460707265



##########
File path: fineract-provider/config/swagger/config.json
##########
@@ -0,0 +1,12 @@
+{
+   "library": "retrofit2",
+   "modelPackage": "org.mifos.models",

Review comment:
       Sorry about that! I missed it out. I'll change it to **org.apache.fineract.client**
   
   To verify the changes:
   - "modelPackage": "org.apache.fineract.client.models"
   - "apiPackage": "org.apache.fineract.client.services"
   - "invokerPackage": "org.apache.fineract.client"
   - "groupId": "org.apache.fineract"
   - "artifactId": "client"
   
   This is how we want right?
   
   > could you put the description about how to use this which you provided above into the/README.md as part of this PR?
   Yeah sure. I'll add this in the Readme.md




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] vorburger commented on a change in pull request #1206: FINERACT-838 Added Swagger Codegen Support

Posted by GitBox <gi...@apache.org>.
vorburger commented on a change in pull request #1206:
URL: https://github.com/apache/fineract/pull/1206#discussion_r460727454



##########
File path: README.md
##########
@@ -263,6 +263,28 @@ API clients (Web UIs, Mobile, etc.)
 * https://github.com/openMF has more related proejcts
 
 
+Generate Apache Fineract API Client
+============
+
+Apache Fineract supports client code generation using [Swagger Codegen](https://github.com/swagger-api/swagger-codegen). Project supports [all clients](https://github.com/swagger-api/swagger-codegen#overview) supported by Swagger Codegen. It uses [OpenAPI Specification Version 3.0.3](https://swagger.io/specification/).
+
+To generate code, execute the following commands:
+
+- **./gradlew build**
+- **./gradlew generateSwaggerCode**
+
+The client code will be generated in the directory **build/swagger-code-fineract**
+
+To build the generated code:
+
+- Navigate to **build/swagger-code-fineract** directory
+- **./gradlew build**

Review comment:
       ```suggestion
   - Run `/gradlew build`
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] Grandolf49 commented on a change in pull request #1206: FINERACT-838 Added Swagger Codegen Support

Posted by GitBox <gi...@apache.org>.
Grandolf49 commented on a change in pull request #1206:
URL: https://github.com/apache/fineract/pull/1206#discussion_r460769242



##########
File path: README.md
##########
@@ -263,6 +263,28 @@ API clients (Web UIs, Mobile, etc.)
 * https://github.com/openMF has more related proejcts
 
 
+Generate Apache Fineract API Client
+============
+
+Apache Fineract supports client code generation using [Swagger Codegen](https://github.com/swagger-api/swagger-codegen). Project supports [all clients](https://github.com/swagger-api/swagger-codegen#overview) supported by Swagger Codegen. It uses [OpenAPI Specification Version 3.0.3](https://swagger.io/specification/).
+
+To generate code, execute the following commands:
+
+- **./gradlew build**
+- **./gradlew generateSwaggerCode**
+
+The client code will be generated in the directory **build/swagger-code-fineract**
+
+To build the generated code:
+
+- Navigate to **build/swagger-code-fineract** directory
+- **./gradlew build**
+
+To customize the generated code:
+
+- Open **fineract-provider/config/swagger/config.json**
+- Refer to [this](https://gist.github.com/Grandolf49/2d222c3d1d0b834ad8f02b5fde8b4c14) for available options in config.json

Review comment:
       @vorburger I have done the necessary changes and created a new client.md. I could also spot some minor corrections in the main readme.md file. So I have updated those too! I hope that's okay! 😅
   
   Let me know if I need to change anything else.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] vorburger commented on a change in pull request #1206: FINERACT-838 Added Swagger Codegen Support

Posted by GitBox <gi...@apache.org>.
vorburger commented on a change in pull request #1206:
URL: https://github.com/apache/fineract/pull/1206#discussion_r460728456



##########
File path: README.md
##########
@@ -263,6 +263,28 @@ API clients (Web UIs, Mobile, etc.)
 * https://github.com/openMF has more related proejcts
 
 
+Generate Apache Fineract API Client
+============
+
+Apache Fineract supports client code generation using [Swagger Codegen](https://github.com/swagger-api/swagger-codegen). Project supports [all clients](https://github.com/swagger-api/swagger-codegen#overview) supported by Swagger Codegen. It uses [OpenAPI Specification Version 3.0.3](https://swagger.io/specification/).
+
+To generate code, execute the following commands:
+
+- **./gradlew build**
+- **./gradlew generateSwaggerCode**
+
+The client code will be generated in the directory **build/swagger-code-fineract**
+
+To build the generated code:
+
+- Navigate to **build/swagger-code-fineract** directory
+- **./gradlew build**
+
+To customize the generated code:
+
+- Open **fineract-provider/config/swagger/config.json**
+- Refer to [this](https://gist.github.com/Grandolf49/2d222c3d1d0b834ad8f02b5fde8b4c14) for available options in config.json

Review comment:
       If you move it to a separate MD docs file, you could just "inline" your entire Gist? Better. Actually, perhaps even better you could link to the appropriate docs page of Swagger CodeGen where they document this? Assuming they have proper doc! :imp: That way, it stays up to date, as we'll upgrade the plugin in the future.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] vorburger commented on a change in pull request #1206: FINERACT-838 Added Swagger Codegen Support

Posted by GitBox <gi...@apache.org>.
vorburger commented on a change in pull request #1206:
URL: https://github.com/apache/fineract/pull/1206#discussion_r460697195



##########
File path: fineract-provider/config/swagger/config.json
##########
@@ -0,0 +1,12 @@
+{
+   "library": "retrofit2",
+   "modelPackage": "org.mifos.models",

Review comment:
       We shouldn't use "org.mifos" for Java package names that are code generated in an Apache project... how about making this e.g. org.apache.fineract.client?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [fineract] Grandolf49 commented on pull request #1206: FINERACT-838 Added Swagger Codegen Support

Posted by GitBox <gi...@apache.org>.
Grandolf49 commented on pull request #1206:
URL: https://github.com/apache/fineract/pull/1206#issuecomment-665327870


   Yeah, sure. I'll revert those changes and update my PR.
   
   Would love to discuss if anything more needs to be done here! :) 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org