diff --git a/.github/PULL_REQUEST_TEMPLATE.MD b/.github/PULL_REQUEST_TEMPLATE.MD index a0defbcb1..c9bc2e3d0 100644 --- a/.github/PULL_REQUEST_TEMPLATE.MD +++ b/.github/PULL_REQUEST_TEMPLATE.MD @@ -17,7 +17,7 @@ Please make sure these boxes are checked before submitting your pull request - t - [ ] Follow coding conventions at https://cwiki.apache.org/confluence/display/FINERACT/Coding+Conventions. -- [ ] Add required Swagger annotation and update API documentation at fineract-provider/src/main/resources/static/api-docs/apiLive.htm with details of any API changes +- [ ] Add required Swagger annotation and update API documentation at fineract-provider/src/main/resources/static/legacy-docs/apiLive.htm with details of any API changes - [ ] Submission is not a "code dump". (Large changes can be made "in repository" via a branch. Ask on the developer mailing list for guidance, if required.) diff --git a/README.md b/README.md index 940137cf5..1c50f6c73 100644 --- a/README.md +++ b/README.md @@ -338,7 +338,7 @@ complies with the [Apache Software Foundation third-party license policy](https: Apache Fineract Platform API ============ -The API for Fineract is documented in [apiLive.htm](fineract-provider/src/main/resources/static/api-docs/apiLive.htm), and the [apiLive.htm can be viewed on Fineract.dev](https://demo.fineract.dev/fineract-provider/api-docs/apiLive.htm "API Documentation"). If you have your own Fineract instance running, you can find this documentation under [/fineract-provider/api-docs/apiLive.htm](https://localhost:8443/fineract-provider/api-docs/apiLive.htm). +The API for Fineract is documented in [apiLive.htm](fineract-provider/src/main/resources/static/api-docs/apiLive.htm), and the [apiLive.htm can be viewed on Fineract.dev](https://demo.fineract.dev/fineract-provider/legacy-docs/apiLive.htm "API Documentation"). If you have your own Fineract instance running, you can find this documentation under [/fineract-provider/api-docs/apiLive.htm](https://localhost:8443/fineract-provider/api-docs/apiLive.htm). The Swagger documentation (work in progress; see [FINERACT-733](https://issues.apache.org/jira/browse/FINERACT-733)) can be accessed under [/fineract-provider/swagger-ui/index.html](https://localhost:8443/fineract-provider/swagger-ui/index.html) and [live Swagger UI here on Fineract.dev](https://demo.fineract.dev/fineract-provider/swagger-ui/index.html). diff --git a/build.gradle b/build.gradle index 419a124ed..8d3ea4758 100644 --- a/build.gradle +++ b/build.gradle @@ -41,6 +41,7 @@ buildscript { 'fineract-client' ].contains(it.name) } + npmRepository = 'https://npm.pkg.github.com' } repositories { maven { url 'https://plugins.gradle.org/m2/' } @@ -87,7 +88,7 @@ Run as: gradle clean bootRun''' ext['groovy.version'] = '3.0.10' -ext['swaggerFile'] = "$rootDir/fineract-provider/build/generated/swagger-ui/fineract.yaml".toString() +ext['swaggerFile'] = "$rootDir/fineract-provider/build/classes/java/main/static/fineract.yaml".toString() allprojects { group = 'org.apache.fineract' @@ -118,7 +119,7 @@ allprojects { mavenBom 'org.springframework.boot:spring-boot-dependencies:2.6.7' mavenBom 'org.jetbrains.kotlin:kotlin-bom:1.6.21' mavenBom 'org.junit:junit-bom:5.8.2' - mavenBom 'com.fasterxml.jackson:jackson-bom:2.13.2.20220328' + mavenBom 'com.fasterxml.jackson:jackson-bom:2.13.2.1' mavenBom 'io.cucumber:cucumber-bom:7.3.2' mavenBom 'io.netty:netty-bom:4.1.76.Final' mavenBom 'org.mockito:mockito-bom:4.5.1' @@ -144,10 +145,15 @@ allprojects { dependency 'com.google.truth:truth:1.1.3' dependency 'com.google.truth.extensions:truth-java8-extension:1.1.3' dependency 'com.google.googlejavaformat:google-java-format:1.15.0' - dependency 'org.apache.commons:commons-email:1.5' + dependency ('org.apache.commons:commons-email:1.5') { + exclude 'com.sun.mail:javax.mail' + exclude 'javax.activation:activation' + } dependency 'commons-io:commons-io:2.11.0' dependency 'com.github.librepdf:openpdf:1.3.27' - dependency 'org.mnode.ical4j:ical4j:3.2.2' + dependency ('org.mnode.ical4j:ical4j:3.2.2') { + exclude 'com.sun.mail:javax.mail' + } dependency 'org.quartz-scheduler:quartz:2.3.2' dependency 'com.amazonaws:aws-java-sdk-s3:1.12.205' dependency 'org.ehcache:ehcache:3.10.0' @@ -157,7 +163,6 @@ allprojects { dependency 'org.apache.httpcomponents:httpclient:4.5.13' dependency 'jakarta.management.j2ee:jakarta.management.j2ee-api:1.1.4' dependency 'jakarta.jms:jakarta.jms-api:2.0.3' - dependency 'jakarta.xml.bind:jakarta.xml.bind-api:2.3.3' // Swagger needs exactly this version dependency 'org.glassfish.jaxb:jaxb-runtime:2.3.6' // Swagger needs exactly this version dependency 'org.apache.bval:org.apache.bval.bundle:2.0.5' dependency 'joda-time:joda-time:2.10.14' @@ -167,7 +172,6 @@ allprojects { dependency 'com.github.spotbugs:spotbugs-annotations:4.6.0' dependency 'javax.cache:cache-api:1.1.1' dependency 'org.mock-server:mockserver-junit-jupiter:5.13.2' - dependency 'org.webjars.npm:swagger-ui-dist:4.10.3' dependency 'org.webjars:webjars-locator-core:0.50' dependency 'com.icegreen:greenmail-junit5:1.6.8' dependency 'com.intuit.karate:karate-junit5:1.2.0.RC6' @@ -198,24 +202,39 @@ allprojects { dependency "com.squareup.okhttp3:okhttp-urlconnection:$okhttpVersion" dependency "com.squareup.okhttp3:okhttp-sse:$okhttpVersion" dependency "io.gsonfire:gson-fire:1.8.5" - dependency "io.swagger:swagger-core:1.6.6" - dependency "io.swagger:swagger-annotations:1.6.6" - dependency "jakarta.annotation:jakarta.annotation-api:1.3.5" dependency "com.google.code.findbugs:jsr305:3.0.2" dependency "commons-codec:commons-codec:1.15" dependency "org.bouncycastle:bcpkix-jdk15to18:1.70" dependency "org.bouncycastle:bcprov-jdk15to18:1.70" dependency "org.projectlombok:lombok:1.18.24" + dependency 'org.springdoc:springdoc-openapi-ui:1.6.8' + dependency 'org.springdoc:springdoc-openapi-webmvc-core:1.6.8' + dependency 'org.springdoc:springdoc-openapi-common:1.6.8' + dependency 'org.springdoc:springdoc-openapi-security:1.6.8' + dependency 'org.springdoc:springdoc-openapi-javadoc:1.6.8' dependency ('org.apache.activemq:activemq-broker:5.17.0') { exclude 'javax.annotation:javax.annotation-api' } + dependency 'io.swagger:swagger-annotations:1.6.6' dependency 'io.swagger.core.v3:swagger-annotations:2.2.0' dependency ('io.swagger.core.v3:swagger-jaxrs2:2.2.0') { exclude 'jakarta.activation:jakarta.activation-api' } + dependency ('io.swagger.core.v3:swagger-core:2.2.0') { + exclude 'jakarta.activation:jakarta.activation-api' + } + + dependency "jakarta.annotation:jakarta.annotation-api:1.3.5" + dependency 'jakarta.activation:jakarta.activation-api:1.2.2' + dependency ('com.sun.mail:jakarta.mail:1.6.7') { + exclude 'com.sun.activation:jakarta.activation' + } + dependency ('jakarta.xml.bind:jakarta.xml.bind-api:2.3.3') { + exclude 'jakarta.activation:jakarta.activation-api' + } dependency ('org.liquibase:liquibase-core:4.9.1') { exclude 'javax.xml.bind:jaxb-api' @@ -228,6 +247,8 @@ allprojects { exclude 'pull-parser:pull-parser' } + dependency 'org.owasp.esapi:esapi:2.3.0.0' + dependencySet(group: 'org.apache.poi', version: '5.2.2') { entry 'poi' entry 'poi-ooxml' @@ -280,8 +301,7 @@ allprojects { "**/results/**", "**/package-info.java", "**/keystore.jks", - "**/static/swagger-ui/**", - "**/api-docs/**", + "**/legacy-docs/**", "**/banner.txt", "**/build.gradle.mustache", "**/pom.mustache", @@ -334,8 +354,6 @@ allprojects { // Notice files '**/NOTICE_RELEASE', '**/NOTICE_SOURCE', - // Swagger License - '**/src/main/resources/static/swagger-ui/**', // gradle '**/.gradle/**', '**/gradlew', @@ -347,7 +365,7 @@ allprojects { '**/wrapper/**', '**/build/**', // Api Docs - '**/api-docs/*.*', + '**/legacy-docs/*.*', '**/docs/system-architecture/.htaccess', '**/docs/system-architecture/404.html', '**/docs/system-architecture/index.html', @@ -366,7 +384,7 @@ allprojects { '**/css/fonts/glyphicons-halflings-regular.svg', '**/assets/jszip.js', '**/assets/jquery.js', - '**/api-docs/jquery-1.7.min.js', + '**/legacy-docs/jquery-1.7.min.js', '**/css/toc-0.1.2/**/*.*', '**/docs/system-architecture/css/main.css', '**/system-architecture/js/vendor/jquery-1.9.1.min.js', diff --git a/fineract-client/build.gradle b/fineract-client/build.gradle index c0307931b..d07c01f02 100644 --- a/fineract-client/build.gradle +++ b/fineract-client/build.gradle @@ -72,14 +72,15 @@ task buildTypescriptAngularSdk(type: org.openapitools.generator.gradle.plugin.ta skipValidateSpec = true inputSpec = "file:///$swaggerFile" outputDir = "$buildDir/generated/typescript".toString() - apiPackage = 'org.apache.fineract.client.services' - invokerPackage = 'org.apache.fineract.client' - modelPackage = 'org.apache.fineract.client.models' + apiPackage = 'apache-fineract-client/services' + invokerPackage = 'apache-fineract-client/invoker' + modelPackage = 'apache-fineract-client/models' configOptions = [ - apiModulePrefix: 'fineract', - configurationPrefix: 'fineract', + apiModulePrefix: 'apacheFineractClient', + configurationPrefix: 'apacheFineractClient', ngVersion: '12.0.0', - npmName: 'apache-fineract-client' + npmName: '@apache/fineract-client', + npmRepository: "${npmRepository}" ] dependsOn = [ ':fineract-provider:resolve' diff --git a/fineract-db/multi-tenant-demo-backups/default-demo/README.md b/fineract-db/multi-tenant-demo-backups/default-demo/README.md index df78ab1f6..39b7f14a9 100644 --- a/fineract-db/multi-tenant-demo-backups/default-demo/README.md +++ b/fineract-db/multi-tenant-demo-backups/default-demo/README.md @@ -12,4 +12,4 @@ This demo database contains: - Its mandatory to have at least one role when creating new users so we have one role created by default called 'Super user' which has the special permission 'Full Authorisation'. Any user with this role can do anything in the system. - Its required to have at least one application user setup so remaining setup can be done through ui so we have on application user created by default with username 'quipo' with a password of 'quipo'. Application users must be associated with an office and a role so this user is associated with 'Latam HO' and 'Super user' role allowing this user to do any operation in any office(branch). -Minimum amount of data to support api-docs interaction. +Minimum amount of data to support legacy-docs interaction. diff --git a/fineract-doc/src/docs/en/oauth.adoc b/fineract-doc/src/docs/en/oauth.adoc index 933b719a9..071c565a4 100644 --- a/fineract-doc/src/docs/en/oauth.adoc +++ b/fineract-doc/src/docs/en/oauth.adoc @@ -63,4 +63,4 @@ curl --location --request GET \ ---- -NOTE: See also https://demo.fineract.dev/fineract-provider/api-docs/apiLive.htm#authentication_oauth +NOTE: See also https://demo.fineract.dev/fineract-provider/legacy-docs/apiLive.htm#authentication_oauth diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle index 1f8f86b65..eaa7e332f 100644 --- a/fineract-provider/build.gradle +++ b/fineract-provider/build.gradle @@ -68,10 +68,10 @@ rat.dependsOn prepareInputYaml resolve { logging.captureStandardOutput LogLevel.INFO outputFileName = 'fineract' - outputFormat = 'YAML' + outputFormat = 'JSONANDYAML' prettyPrint = true classpath = sourceSets.main.runtimeClasspath - outputDir = file("${buildDir}/generated/swagger-ui") + outputDir = file("${buildDir}/classes/java/main/static") openApiFile = file("config/swagger/fineract-input.yaml") sortOutput = true } @@ -215,34 +215,22 @@ bootRun { implementation 'org.mariadb.jdbc:mariadb-java-client:2.7.5' implementation 'org.postgresql:postgresql:42.3.4' } - - classpath += files("build/generated/swagger-ui") } springBoot { mainClass = 'org.apache.fineract.ServerApplication' + buildInfo() } bootJar { duplicatesStrategy = DuplicatesStrategy.EXCLUDE manifest { - attributes 'Main-Class': 'org.springframework.boot.loader.PropertiesLauncher', 'Implementation-Title': 'Apache Fineract', 'Implementation-Version': archiveVersion + attributes('Main-Class': 'org.springframework.boot.loader.PropertiesLauncher', 'Implementation-Title': 'Apache Fineract', 'Implementation-Version': archiveVersion) } dependsOn resolve classifier = '' - - from('build/generated/swagger-ui') { - into 'BOOT-INF/classes/static/swagger-ui' - } } -jar { - from('build/generated/swagger-ui') { - include '*' - } -} - -jar.dependsOn resolve jar.dependsOn bootJar jib { @@ -296,15 +284,6 @@ jib { implementation 'org.postgresql:postgresql:42.3.4' } - extraDirectories { - paths { - path { - from = file('build/generated/swagger-ui') - into = "/app/classes" - } - } - } - pluginExtensions { pluginExtension { implementation = 'com.google.cloud.tools.jib.gradle.extension.layerfilter.JibLayerFilterExtension' diff --git a/fineract-provider/config/swagger/fineract-input.yaml.template b/fineract-provider/config/swagger/fineract-input.yaml.template index 63268f008..3202c903a 100644 --- a/fineract-provider/config/swagger/fineract-input.yaml.template +++ b/fineract-provider/config/swagger/fineract-input.yaml.template @@ -3,19 +3,11 @@ info: version: @VERSION@ 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
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 + 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. + The reference app (username: mifos, password: password) works on the same demo tenant as the interactive links in this documentation. + Until we complete the new REST API documentation you still have the legacy documentation available here. + Please check the Fineract documentation for more information. contact: email: dev@fineract.apache.org license: diff --git a/fineract-provider/dependencies.gradle b/fineract-provider/dependencies.gradle index 536c23c2c..de3fb667a 100644 --- a/fineract-provider/dependencies.gradle +++ b/fineract-provider/dependencies.gradle @@ -63,13 +63,22 @@ dependencies { 'com.github.spotbugs:spotbugs-annotations', 'io.swagger.core.v3:swagger-annotations', - 'org.webjars:webjars-locator-core', 'com.google.cloud.sql:mysql-socket-factory-connector-j-8:1.5.0', 'com.squareup.retrofit2:converter-gson', - 'org.apache.commons:commons-email' + 'com.sun.activation:jakarta.activation', + 'com.sun.mail:jakarta.mail', + + 'org.springdoc:springdoc-openapi-ui', + 'org.springdoc:springdoc-openapi-common', + 'org.springdoc:springdoc-openapi-security', ) + implementation ('org.apache.commons:commons-email:1.5') { + exclude group: 'com.sun.mail', module: 'javax.mail' + exclude group: 'javax.activation', module: 'activation' + } + implementation('org.springframework.boot:spring-boot-starter-jersey') { exclude group: 'org.glassfish.hk2.external', module: 'aopalliance-repackaged' exclude group: 'org.glassfish.hk2', module: 'hk2-runlevel' @@ -84,11 +93,12 @@ dependencies { } implementation ('org.apache.activemq:activemq-broker') { exclude group: 'org.apache.geronimo.specs' + exclude group: 'javax.annotation', module: 'javax.annotation-api' } implementation ('org.springframework.boot:spring-boot-starter-data-jpa') { exclude group: 'org.hibernate' } - implementation('org.eclipse.persistence:org.eclipse.persistence.jpa:2.7.10') { + implementation('org.eclipse.persistence:org.eclipse.persistence.jpa') { exclude group: 'org.eclipse.persistence', module: 'jakarta.persistence' } implementation ('org.quartz-scheduler:quartz') { @@ -100,13 +110,14 @@ dependencies { implementation ('org.mnode.ical4j:ical4j') { exclude group: 'commons-logging' exclude group: 'javax.activation' + exclude group: 'com.sun.mail', module: 'javax.mail' } implementation ('org.ehcache:ehcache') { exclude group: 'com.sun.activation' } - implementation('org.owasp.esapi:esapi:2.3.0.0') { + implementation('org.owasp.esapi:esapi') { exclude group: 'org.slf4j' exclude group: 'log4j' exclude group: 'commons-logging' @@ -125,7 +136,6 @@ dependencies { runtimeOnly( 'org.apache.bval:org.apache.bval.bundle', 'org.springframework.boot:spring-boot-starter-actuator', - 'org.webjars.npm:swagger-ui-dist', // Although fineract (at the time of writing) doesn't have any compile time dep. on httpclient, // it's useful to have this for the Spring Boot TestRestTemplate http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#boot-features-rest-templates-test-utility diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/config/WebFrontEndConfiguration.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/config/WebFrontEndConfiguration.java deleted file mode 100644 index 7e85d1ec7..000000000 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/config/WebFrontEndConfiguration.java +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.fineract.infrastructure.core.config; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.context.annotation.Configuration; -import org.springframework.web.servlet.config.annotation.EnableWebMvc; -import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; -import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; -import org.webjars.WebJarAssetLocator; - -@EnableWebMvc -@Configuration -public class WebFrontEndConfiguration implements WebMvcConfigurer { - - private static final Logger LOG = LoggerFactory.getLogger(WebFrontEndConfiguration.class); - - private static final String[] CLASSPATH_RESOURCE_LOCATIONS = { "classpath:/static/", "classpath:/public/" }; - - @Override - public void addResourceHandlers(ResourceHandlerRegistry registry) { - if (!registry.hasMappingForPattern("/**")) { - registry.addResourceHandler("/**").addResourceLocations(CLASSPATH_RESOURCE_LOCATIONS); - } - - WebJarAssetLocator locator = new WebJarAssetLocator(); - String fullPathToSwaggerUiJs = locator.getFullPath("swagger-ui.js"); - LOG.info("Found Swagger UI at {}", fullPathToSwaggerUiJs); - String fullPathToSwaggerUi = fullPathToSwaggerUiJs.substring(0, fullPathToSwaggerUiJs.lastIndexOf("/") + 1); - - final String[] swaggerResourceLocations = { "classpath:/static/swagger-ui/", "classpath:fineract.yaml", - "classpath:" + fullPathToSwaggerUi }; - - registry.addResourceHandler("/swagger-ui/**").addResourceLocations(swaggerResourceLocations); - } - - @Override - public void addViewControllers(ViewControllerRegistry registry) { - registry.addRedirectViewController("/swagger-ui", "/swagger-ui/index.html"); - registry.addRedirectViewController("/swagger-ui/", "/swagger-ui/index.html"); - } -} diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/survey/api/SurveyApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/survey/api/SurveyApiResource.java index b4805dbb2..2cf9acad4 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/survey/api/SurveyApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/survey/api/SurveyApiResource.java @@ -120,7 +120,7 @@ public class SurveyApiResource { @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Create an entry in the survey table", description = "Insert and entry in a survey table (full fill the survey)." + "\n" + "\n" - + "Refer Link for sample Body: [ https://demo.fineract.dev/fineract-provider/api-docs/apiLive.htm#survey_create ] ") + + "Refer Link for sample Body: [ https://demo.fineract.dev/fineract-provider/legacy-docs/apiLive.htm#survey_create ] ") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = SurveyApiResourceSwagger.PostSurveySurveyNameApptableIdRequest.class))) @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SurveyApiResourceSwagger.PostSurveySurveyNameApptableIdResponse.class))) }) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/accounts/api/AccountsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/accounts/api/AccountsApiResource.java index 84237b78e..6489e4b60 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/accounts/api/AccountsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/accounts/api/AccountsApiResource.java @@ -200,7 +200,7 @@ public class AccountsApiResource { + "requestedDate is requsted date of shares redeem\n" + "\n" + "requestedShares is number of shares to be redeemed\n\n" + "Mandatory Fields: dateFormat,locale,requestedDate,requestedShares\n\n" + "Showing request/response for 'Reject additional shares request on a share account'\n\n" - + "For more info visit this link - https://demo.fineract.dev/fineract-provider/api-docs/apiLive.htm#shareaccounts") + + "For more info visit this link - https://demo.fineract.dev/fineract-provider/legacy-docs/apiLive.htm#shareaccounts") @RequestBody(required = true, content = @Content(schema = @Schema(implementation = AccountsApiResourceSwagger.PostAccountsTypeAccountIdRequest.class))) @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = AccountsApiResourceSwagger.PostAccountsTypeAccountIdResponse.class))) }) diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/security/api/SelfAuthenticationApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/security/api/SelfAuthenticationApiResource.java index cbdd50c9e..784912de2 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/security/api/SelfAuthenticationApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/security/api/SelfAuthenticationApiResource.java @@ -53,7 +53,7 @@ public class SelfAuthenticationApiResource { @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Verify authentication", description = "Authenticates the credentials provided and returns the set roles and permissions allowed.\n\n" - + "Please visit this link for more info - https://demo.fineract.dev/fineract-provider/api-docs/apiLive.htm#selfbasicauth") + + "Please visit this link for more info - https://demo.fineract.dev/fineract-provider/legacy-docs/apiLive.htm#selfbasicauth") @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SelfAuthenticationApiResourceSwagger.PostSelfAuthenticationResponse.class))) }) public String authenticate(final String apiRequestBodyAsJson) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/security/api/SelfUserDetailsApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/security/api/SelfUserDetailsApiResource.java index bbacd50d6..dd893042d 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/security/api/SelfUserDetailsApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/self/security/api/SelfUserDetailsApiResource.java @@ -52,7 +52,7 @@ public class SelfUserDetailsApiResource { @GET @Produces({ MediaType.APPLICATION_JSON }) @Operation(summary = "Fetch authenticated user details", description = "Checks the Authentication and returns the set roles and permissions allowed\n\n" - + "For more info visit this link - https://demo.fineract.dev/fineract-provider/api-docs/apiLive.htm#selfoauth") + + "For more info visit this link - https://demo.fineract.dev/fineract-provider/legacy-docs/apiLive.htm#selfoauth") @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = SelfUserDetailsApiResourceSwagger.GetSelfUserDetailsResponse.class))) }) public String fetchAuthenticatedUserData() { diff --git a/fineract-provider/src/main/resources/application.properties b/fineract-provider/src/main/resources/application.properties index 9eb4aae35..1d3fc966e 100644 --- a/fineract-provider/src/main/resources/application.properties +++ b/fineract-provider/src/main/resources/application.properties @@ -17,6 +17,8 @@ # under the License. # +application.title=Apache Fineract + fineract.node-id=${FINERACT_NODE_ID:1} fineract.security.basicauth.enabled=${FINERACT_SECURITY_BASICAUTH_ENABLED:true} @@ -111,3 +113,15 @@ spring.liquibase.parameters.fineract.tenant.port=${fineract.tenant.port} spring.liquibase.parameters.fineract.tenant.username=${fineract.tenant.username} spring.liquibase.parameters.fineract.tenant.password=${fineract.tenant.password} spring.liquibase.parameters.fineract.tenant.parameters=${fineract.tenant.parameters} + +springdoc.api-docs.path=${SPRINGDOC_API_DOCS_PATH:/api-docs} +springdoc.api-docs.enabled=${SPRINGDOC_API_DOCS_ENABLED:true} +springdoc.swagger-ui.enabled=${SPRINGDOC_SWAGGER_UI_ENABLED:true} +springdoc.swagger-ui.display-query-params=true +springdoc.swagger-ui.url=/fineract.json +springdoc.packagesToScan=org.apache.fineract +springdoc.pathsToMatch=/api/** +springdoc.use-management-port=${SPRINGDOC_USE_MANAGEMENT_PORT:false} +springdoc.show-actuator=${SPRINGDOC_SHOW_ACTUATOR:false} + +spring.web.resources.static-locations=classpath:/static/ diff --git a/fineract-provider/src/main/resources/banner.txt b/fineract-provider/src/main/resources/banner.txt index fde559df0..6103c57b9 100644 --- a/fineract-provider/src/main/resources/banner.txt +++ b/fineract-provider/src/main/resources/banner.txt @@ -6,7 +6,7 @@ /_/ \_\ .__/ \__,_|\___|_| |_|\___| |_| |_|_| |_|\___|_| \__,_|\___|\__| |_| -${AnsiStyle.FAINT}${AnsiColor.WHITE}version ${application.version}${AnsiColor.BLACK} +${AnsiStyle.FAINT}${AnsiColor.WHITE}(c) 2015-2022 ${application.title} (https://fineract.apache.org)${AnsiColor.BLACK} ${AnsiStyle.FAINT}${AnsiColor.WHITE}Powered by Spring Boot ${spring-boot.version}${AnsiColor.BLACK} diff --git a/fineract-provider/src/main/resources/static/api-docs/apiLive.htm b/fineract-provider/src/main/resources/static/legacy-docs/apiLive.htm similarity index 100% rename from fineract-provider/src/main/resources/static/api-docs/apiLive.htm rename to fineract-provider/src/main/resources/static/legacy-docs/apiLive.htm diff --git a/fineract-provider/src/main/resources/static/api-docs/apidocs.css b/fineract-provider/src/main/resources/static/legacy-docs/apidocs.css similarity index 100% rename from fineract-provider/src/main/resources/static/api-docs/apidocs.css rename to fineract-provider/src/main/resources/static/legacy-docs/apidocs.css diff --git a/fineract-provider/src/main/resources/static/api-docs/jquery-1.7.min.js b/fineract-provider/src/main/resources/static/legacy-docs/jquery-1.7.min.js similarity index 100% rename from fineract-provider/src/main/resources/static/api-docs/jquery-1.7.min.js rename to fineract-provider/src/main/resources/static/legacy-docs/jquery-1.7.min.js diff --git a/fineract-provider/src/main/resources/static/swagger-ui/index.html b/fineract-provider/src/main/resources/static/swagger-ui/index.html deleted file mode 100644 index b5a6fe02b..000000000 --- a/fineract-provider/src/main/resources/static/swagger-ui/index.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - Swagger UI - - - - - - - -
- - - - - - diff --git a/integration-tests/src/test/java/org/apache/fineract/integrationtests/ApiDocsTest.java b/integration-tests/src/test/java/org/apache/fineract/integrationtests/ApiDocsTest.java index c1b169ed0..15d465713 100644 --- a/integration-tests/src/test/java/org/apache/fineract/integrationtests/ApiDocsTest.java +++ b/integration-tests/src/test/java/org/apache/fineract/integrationtests/ApiDocsTest.java @@ -41,7 +41,7 @@ public class ApiDocsTest { @Test public void testApiDocsAccess() { - Utils.performServerGet(requestSpec, responseSpec, "/fineract-provider/api-docs/apiLive.htm", null); + Utils.performServerGet(requestSpec, responseSpec, "/fineract-provider/legacy-docs/apiLive.htm", null); } } diff --git a/integration-tests/src/test/java/org/apache/fineract/integrationtests/SwaggeruiTest.java b/integration-tests/src/test/java/org/apache/fineract/integrationtests/SwaggeruiTest.java index 51744ec15..3f8e516f8 100644 --- a/integration-tests/src/test/java/org/apache/fineract/integrationtests/SwaggeruiTest.java +++ b/integration-tests/src/test/java/org/apache/fineract/integrationtests/SwaggeruiTest.java @@ -44,9 +44,8 @@ public class SwaggeruiTest { @Test public void testSwaggeruiAccess() { - Utils.performServerGet(requestSpec, responseSpec, "/fineract-provider/swagger-ui", null); Utils.performServerGet(requestSpec, responseSpec, "/fineract-provider/swagger-ui/index.html", null); - Utils.performServerGet(requestSpec, responseSpec, "/fineract-provider/swagger-ui/fineract.yaml", null); + Utils.performServerGet(requestSpec, responseSpec, "/fineract-provider/fineract.json", null); } } diff --git a/oauth2-tests/src/test/java/org/apache/fineract/oauth2tests/OAuth2AuthenticationTest.java b/oauth2-tests/src/test/java/org/apache/fineract/oauth2tests/OAuth2AuthenticationTest.java index d688de1f5..6a2ecd7f9 100644 --- a/oauth2-tests/src/test/java/org/apache/fineract/oauth2tests/OAuth2AuthenticationTest.java +++ b/oauth2-tests/src/test/java/org/apache/fineract/oauth2tests/OAuth2AuthenticationTest.java @@ -72,7 +72,7 @@ public class OAuth2AuthenticationTest { @Test public void testApiDocsAccess() { - performServerGet(requestSpec, responseSpec, "/fineract-provider/api-docs/apiLive.htm", null); + performServerGet(requestSpec, responseSpec, "/fineract-provider/legacy-docs/apiLive.htm", null); } @Test diff --git a/twofactor-tests/src/test/java/org/apache/fineract/twofactortests/TwoFactorAuthenticationTest.java b/twofactor-tests/src/test/java/org/apache/fineract/twofactortests/TwoFactorAuthenticationTest.java index 82692988d..2aceb7222 100644 --- a/twofactor-tests/src/test/java/org/apache/fineract/twofactortests/TwoFactorAuthenticationTest.java +++ b/twofactor-tests/src/test/java/org/apache/fineract/twofactortests/TwoFactorAuthenticationTest.java @@ -97,7 +97,7 @@ public class TwoFactorAuthenticationTest { @Test public void testApiDocsAccess() { - performServerGet(requestSpecWithoutBasic, responseSpec, "/fineract-provider/api-docs/apiLive.htm", null); + performServerGet(requestSpecWithoutBasic, responseSpec, "/fineract-provider/legacy-docs/apiLive.htm", null); } @Test