[
https://issues.apache.org/jira/browse/FINERACT-838?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17169309#comment-17169309
]
Chinmay Kulkarni commented on FINERACT-838:
-------------------------------------------
[~vorburger] Thanks for merging the PR! Here are my thoughts on the above
points you mentioned.
A. I agree with this. Ideally, in every build, this should be tested to prevent
the "generated client code" from breaking. I have experimented with this in my
[https://github.com/Grandolf49/fineract-client] repository. I tried setting up
CircleCi in the repository to build and test the generated code to ensure if
everything is working correctly. Check this
[https://github.com/Grandolf49/fineract-client/blob/master/.circleci/config.yml]
(here tests are skipped for temporary purpose) for example.
I recommend adding the build to
[.travis.yml|https://github.com/apache/fineract/blob/develop/.travis.yml] only.
IMO the user might not want to use the "Generated Code" in each build. So we
can exclude it from Gradle to locally build it for everyone. Of course, the
user is free to **run *./gradlew generateSwaggerCode* after the local build is
complete.
B. Having a separate project for testing the generated code seems like an
interesting idea! I'm guessing we will have to write a custom Gradle task to
first generate the artifact and test this "separate" project that depends on
this artifact. For now, we can work on first adding the build to TravisCI then
later (or simultaneously) figure out a way to implement this.
C. Yes, it makes sense to release the artifact to Maven Central (or any other
distribution). I experimented with this on my
[https://github.com/Grandolf49/fineract-client] repo. I tried to configure
CircleCi to automatically create a Github release, anytime when a *git tag* is
pushed. Check this part:
[https://github.com/Grandolf49/fineract-client/blob/1c08cd42a989d5fdda60bbda47c967e720e60d49/.circleci/config.yml#L53]
(not suggesting we do it like this).
This was actually one of my objectives of GSoC. Once the SDK is published to
maven or jitpack, Android projects of Mifos can use this SDK to abstract a huge
amount of code (which is really required).
> Swagger generated client libraries
> ----------------------------------
>
> Key: FINERACT-838
> URL: https://issues.apache.org/jira/browse/FINERACT-838
> Project: Apache Fineract
> Issue Type: Sub-task
> Reporter: Michael Vorburger
> Assignee: Chinmay Kulkarni
> Priority: Major
> Fix For: 1.4.0
>
>
> In the review discussion of the first Swagger PR
> https://github.com/apache/fineract/pull/629 (which got superseded by
> https://github.com/apache/fineract/pull/695), this came up:
> {quote}The other plugin org.hidetake.swagger.generator is used to generate
> code from the openAPI spec file using swagger-codegen. So this does not
> generate response.json. It rather uses response.json to generate client
> code.{quote}
> and {quote} think i had explained the usage of this in my gist
> https://gist.github.com/kangbreder/034f47e2e8015cee10b48b7c5f1b8df1,
> generating client libraries and language-specific SDKs in languages such as
> java and angular from swagger specification file. This was part of the goals
> of the project listed in
> https://mifosforge.jira.com/wiki/spaces/RES/pages/812810251/Google+Summer+of+Code+2019+Ideas.{quote}
> Having (Swagger automatically generate!) client libraries in Java (and even
> other languages?!) seems like a cool idea. It's also something that perhaps
> needs a bit more investigation than only adding the respective Gradle plugin.
> If we actually do do this, after having done all of the work in the other
> Sub Tasks, then I think we would have to include sample code in the repo
> building against the generated client libraries to test and illustrate their
> usage. We would also have to publish those client libraries, e.g. as
> downloadable JAR from the release page (or later even made available on Maven
> central). It would perhaps be clearest if there was another directory in the
> Fineract source tree, next to and outside of not inside, the
> fineract-provider (which is the "server") for this purpose.
> [~kangbreder] [~awasum] [~sanyam] ([~sanyam96] ?) FYI
--
This message was sent by Atlassian Jira
(v8.3.4#803005)