Initial Swagger related changes from GSOC 2019 contrib (FINERACT-733)
This commit does not yet provide the full Swagger requirement, as was outlined in FINERACT-733, but it's a first step forming the basis of more to come (hopefully). Here's the original PR description (but note that some of this is about to be reverted in the next commit): Reflected all API descriptions on swagger UI. Formatted API descriptions. Added swagger docs for new APIs. Added swagger-gradle-plugin for automatic save of json during build. Leveraged swagger codegen for generation of language-specific libraries using gradle-swagger-generator plugin.
This commit is contained in:
committed by
Michael Vorburger ⛑️
parent
b0dce97b82
commit
e424471162
@@ -43,9 +43,12 @@ buildscript {
|
||||
classpath 'com.radcortez.gradle:openjpa-gradle-plugin:3.1.0'
|
||||
classpath 'gradle.plugin.org.nosphere.apache:creadur-rat-gradle:0.2.2'
|
||||
classpath "com.github.spotbugs:spotbugs-gradle-plugin:2.0.1"
|
||||
//Use Guava version 23+ as a workaround to spotbug intergration.
|
||||
//Use Guava version 23+ as a workaround to spotbug intergration.
|
||||
// See: https://github.com/spotbugs/spotbugs-gradle-plugin/issues/128#issuecomment-535864882
|
||||
classpath 'com.google.guava:guava:28.1-jre'
|
||||
classpath 'com.google.guava:guava:28.1-jre'
|
||||
|
||||
classpath "io.swagger.core.v3:swagger-gradle-plugin:2.0.8"
|
||||
classpath "gradle.plugin.org.hidetake:gradle-swagger-generator-plugin:2.18.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,6 +62,8 @@ apply plugin: 'eclipse'
|
||||
apply plugin: 'idea'
|
||||
apply plugin: 'com.bmuschko.tomcat'
|
||||
apply plugin: 'project-report'
|
||||
apply plugin: 'java'
|
||||
apply plugin: "org.hidetake.swagger.generator"
|
||||
apply plugin: 'java-library'
|
||||
apply plugin: 'openjpa'
|
||||
apply plugin: "com.github.spotbugs"
|
||||
@@ -69,7 +74,7 @@ dependencyManagement {
|
||||
imports {
|
||||
mavenBom 'org.springframework:spring-framework-bom:5.1.10.RELEASE'
|
||||
}
|
||||
|
||||
|
||||
dependencies {
|
||||
dependency 'org.springframework.security.oauth:spring-security-oauth2:2.3.6.RELEASE'
|
||||
dependency 'org.apache.openjpa:openjpa:3.1.0'
|
||||
@@ -207,6 +212,7 @@ rat {
|
||||
'**/docs/system-architecture/**/*.xml',
|
||||
'**/bootstrap-3.0.0/assets/application.js',
|
||||
'**/system-architecture/js/plugins.js',
|
||||
'**/docs/interoperation/specification/json/*.json',
|
||||
|
||||
//Apache License
|
||||
'**/bootstrap-3.0.0/assets/less.js',
|
||||
@@ -529,3 +535,30 @@ tasks.withType(SpotBugsTask) {
|
||||
reports.html.enabled = true
|
||||
reportLevel = "high"
|
||||
}
|
||||
|
||||
// This is to save json file at build time
|
||||
resolve {
|
||||
outputFileName = 'response.json'
|
||||
outputFormat = 'JSON'
|
||||
prettyPrint = 'TRUE'
|
||||
classpath = sourceSets.main.runtimeClasspath
|
||||
resourcePackages = ['org.apache.fineract']
|
||||
outputPath = '/src/main/resources/swagger-ui/response.json'
|
||||
}
|
||||
|
||||
//This is for code and swagger UI generation
|
||||
dependencies {
|
||||
swaggerCodegen 'io.swagger:swagger-codegen-cli:2.4.2' // Swagger Codegen V2
|
||||
swaggerCodegen 'io.swagger.codegen.v3:swagger-codegen-cli:3.0.5' // or Swagger Codegen V3
|
||||
swaggerCodegen 'org.openapitools:openapi-generator-cli:3.3.4' // or OpenAPI Generator
|
||||
swaggerUI 'org.webjars:swagger-ui:3.10.0'
|
||||
}
|
||||
|
||||
swaggerSources {
|
||||
fineract {
|
||||
inputFile = file('src/main/resources/swagger-ui/response.json')
|
||||
code {
|
||||
language = 'java'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user