[ 
https://issues.apache.org/jira/browse/FINERACT-837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17154184#comment-17154184
 ] 

Petri Tuomola commented on FINERACT-837:
----------------------------------------

Hi [~Manthan] 

Yes, I'd see as next step adding the metadata to the generated fineract.json - 
including the correct URLs. This should be a few minutes job so I can see if I 
can do this later today. You're right that fixing the links in the old 
response.json has limited value.

And in terms of the Swagger UI JS files: we don't need to check them in 
ourselves anymore, as the whole Swagger UI application is included through the 
runtime dependency in the Gradle file (dependency on 
'org.webjars.npm:swagger-ui-dist'), and Tomcat is then instructed to route 
requests for /swagger-ui to the WebJar (see code in 
org.apache.fineract.infrastructure.core.boot.WebFrontEndConfiguration). In my 
view this is much better than checking in source code from another project into 
Fineract...

The only problem how I've implemented this so far is that the code in 
org.apache.fineract.infrastructure.core.boot.WebFrontEndConfiguration refers to 
the WebJAR with a specific version number. When we upgrade the dependency we 
need to also change the source code to point to the right version. A better 
solution would be to make this version agnostic - either by using the 
webjars-locator 
([https://mvnrepository.com/artifact/org.webjars/webjars-locator) 
|https://mvnrepository.com/artifact/org.webjars/webjars-locator]or by simply 
writing some code to find swagger.json from classpath and using the found 
location to determine the right resource location to use. 

 

> Make swagger-ui/response.json (?) a pure built time artifact, and remove it 
> from Git
> ------------------------------------------------------------------------------------
>
>                 Key: FINERACT-837
>                 URL: https://issues.apache.org/jira/browse/FINERACT-837
>             Project: Apache Fineract
>          Issue Type: Sub-task
>            Reporter: Michael Vorburger
>            Assignee: Petri Tuomola
>            Priority: Major
>
> Once FINERACT-835 is fully implemented (do not start working on this until 
> FINERACT-835 is merged), and just in order to reduce confusion about what is 
> manually maintained and what is provided by the build, IMHO we really should 
> make swagger-ui/response.json (or whatever will replace it?) a pure built 
> time artifact.
> What I mean is that {{./gradlew build}} should produce this file at the 
> appropriate place under {{build/}}, from where it should be picked up and 
> included in the right place in the WAR. That file should then be removed from 
> Git in {{src/main/resources/swagger-ui/response.json}} where it currently 
> lives.
> I guess it would be cool to make this change after having the test proposed 
> in FINERACT-836 just to "prove" that "it (?) still works as before and 
> nothing broke".
> The assumption I've made here is that it's best to have this JSON file built 
> at run-time. I know little about Swagger, and if the conclusion is that it's 
> better and fine to just have something (Swagger runtime) build the Swagger 
> JSON (YAML?) through scanning the annotations at runtime, and that's how this 
> is typically done, then we can of course forget about, and just remove the 
> {{src/main/resources/swagger-ui/response.json}} completely.
> [~kangbreder]  would you like to do this? Please raise PR with ONLY this 
> change, nothing else.
> [~awasum] [~sanyam] ([~sanyam96] ?) FYI



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to