diff options
author | Wojciech Sliwka <wojciech.sliwka@nokia.com> | 2019-04-09 14:57:02 +0200 |
---|---|---|
committer | Wojciech Sliwka <wojciech.sliwka@nokia.com> | 2019-04-09 14:57:02 +0200 |
commit | 86683c58addadfeabe12d10c2fa26cfead22c2fe (patch) | |
tree | 12b8eb0918439c87145d112c1cf05593cc85f3b5 /vid-app-common/src | |
parent | 2e77a83940fbe63305045ae8712404e38e8be185 (diff) |
Support for swagger
API definitions available under /vid/v2/api-docs
Change-Id: Ie7e63bfbdb8d41c43bc04ca13351dba533776a8a
Issue-ID: VID-377
Signed-off-by: Wojciech Sliwka <wojciech.sliwka@nokia.com>
Diffstat (limited to 'vid-app-common/src')
-rw-r--r-- | vid-app-common/src/main/java/org/onap/vid/controller/WebConfig.java | 15 | ||||
-rw-r--r-- | vid-app-common/src/main/java/org/onap/vid/controller/open/HealthCheckController.java (renamed from vid-app-common/src/main/java/org/onap/vid/controller/HealthCheckController.java) | 3 | ||||
-rw-r--r-- | vid-app-common/src/main/java/org/onap/vid/controller/open/MaintenanceController.java (renamed from vid-app-common/src/main/java/org/onap/vid/controller/MaintenanceController.java) | 2 | ||||
-rw-r--r-- | vid-app-common/src/main/java/org/onap/vid/controller/open/RoleGeneratorController.java (renamed from vid-app-common/src/main/java/org/onap/vid/controller/RoleGeneratorController.java) | 2 | ||||
-rw-r--r-- | vid-app-common/src/main/java/org/onap/vid/controller/open/VersionController.java (renamed from vid-app-common/src/main/java/org/onap/vid/controller/VersionController.java) | 2 | ||||
-rw-r--r-- | vid-app-common/src/test/java/org/onap/vid/controller/open/HealthCheckControllerTest.java (renamed from vid-app-common/src/test/java/org/onap/vid/controller/HealthCheckControllerTest.java) | 3 | ||||
-rw-r--r-- | vid-app-common/src/test/java/org/onap/vid/controller/open/MaintenanceControllerTest.java (renamed from vid-app-common/src/test/java/org/onap/vid/controller/MaintenanceControllerTest.java) | 3 | ||||
-rw-r--r-- | vid-app-common/src/test/java/org/onap/vid/controller/open/RoleGeneratorControllerTest.java (renamed from vid-app-common/src/test/java/org/onap/vid/controller/RoleGeneratorControllerTest.java) | 3 | ||||
-rw-r--r-- | vid-app-common/src/test/java/org/onap/vid/controller/open/VersionControllerTest.java (renamed from vid-app-common/src/test/java/org/onap/vid/controller/VersionControllerTest.java) | 3 |
9 files changed, 28 insertions, 8 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/WebConfig.java b/vid-app-common/src/main/java/org/onap/vid/controller/WebConfig.java index 543aa9432..e00c2d7a5 100644 --- a/vid-app-common/src/main/java/org/onap/vid/controller/WebConfig.java +++ b/vid-app-common/src/main/java/org/onap/vid/controller/WebConfig.java @@ -42,11 +42,18 @@ import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.togglz.core.manager.FeatureManager; +import springfox.documentation.builders.PathSelectors; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + import javax.servlet.ServletContext; import java.io.File; import java.io.IOException; +@EnableSwagger2 @Configuration public class WebConfig { @@ -193,4 +200,12 @@ public class WebConfig { } + @Bean + public Docket api(){ + return new Docket(DocumentationType.SWAGGER_2) + .select() + .apis(RequestHandlerSelectors.basePackage("org.onap.vid.controller.open")) + .paths(PathSelectors.any()) + .build(); + } } diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/HealthCheckController.java b/vid-app-common/src/main/java/org/onap/vid/controller/open/HealthCheckController.java index 04d5babcc..92e1a1802 100644 --- a/vid-app-common/src/main/java/org/onap/vid/controller/HealthCheckController.java +++ b/vid-app-common/src/main/java/org/onap/vid/controller/open/HealthCheckController.java @@ -18,11 +18,12 @@ * ============LICENSE_END========================================================= */ -package org.onap.vid.controller; +package org.onap.vid.controller.open; import org.onap.portalsdk.core.controller.UnRestrictedBaseController; import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.onap.portalsdk.core.util.SystemProperties; +import org.onap.vid.controller.HealthStatus; import org.onap.vid.dao.FnAppDoaImpl; import org.onap.vid.model.GitRepositoryState; import org.springframework.beans.factory.annotation.Autowired; diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/MaintenanceController.java b/vid-app-common/src/main/java/org/onap/vid/controller/open/MaintenanceController.java index dfba4e31a..d1004401a 100644 --- a/vid-app-common/src/main/java/org/onap/vid/controller/MaintenanceController.java +++ b/vid-app-common/src/main/java/org/onap/vid/controller/open/MaintenanceController.java @@ -1,4 +1,4 @@ -package org.onap.vid.controller; +package org.onap.vid.controller.open; /*- * ============LICENSE_START======================================================= diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/RoleGeneratorController.java b/vid-app-common/src/main/java/org/onap/vid/controller/open/RoleGeneratorController.java index 107142d7f..7b57df2c7 100644 --- a/vid-app-common/src/main/java/org/onap/vid/controller/RoleGeneratorController.java +++ b/vid-app-common/src/main/java/org/onap/vid/controller/open/RoleGeneratorController.java @@ -19,7 +19,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.vid.controller; +package org.onap.vid.controller.open; import static org.springframework.http.HttpStatus.OK; diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/VersionController.java b/vid-app-common/src/main/java/org/onap/vid/controller/open/VersionController.java index aa15f0fa3..0a4d6f5ac 100644 --- a/vid-app-common/src/main/java/org/onap/vid/controller/VersionController.java +++ b/vid-app-common/src/main/java/org/onap/vid/controller/open/VersionController.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.vid.controller; +package org.onap.vid.controller.open; import com.fasterxml.jackson.core.type.TypeReference; diff --git a/vid-app-common/src/test/java/org/onap/vid/controller/HealthCheckControllerTest.java b/vid-app-common/src/test/java/org/onap/vid/controller/open/HealthCheckControllerTest.java index 49e6645bc..76ee5617b 100644 --- a/vid-app-common/src/test/java/org/onap/vid/controller/HealthCheckControllerTest.java +++ b/vid-app-common/src/test/java/org/onap/vid/controller/open/HealthCheckControllerTest.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.vid.controller; +package org.onap.vid.controller.open; import org.apache.log4j.BasicConfigurator; import org.junit.Before; @@ -26,6 +26,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; +import org.onap.vid.controller.open.HealthCheckController; import org.onap.vid.dao.FnAppDoaImpl; import org.springframework.http.MediaType; import org.springframework.test.web.servlet.MockMvc; diff --git a/vid-app-common/src/test/java/org/onap/vid/controller/MaintenanceControllerTest.java b/vid-app-common/src/test/java/org/onap/vid/controller/open/MaintenanceControllerTest.java index b9193810a..3e78828f0 100644 --- a/vid-app-common/src/test/java/org/onap/vid/controller/MaintenanceControllerTest.java +++ b/vid-app-common/src/test/java/org/onap/vid/controller/open/MaintenanceControllerTest.java @@ -1,4 +1,4 @@ -package org.onap.vid.controller; +package org.onap.vid.controller.open; /*- * ============LICENSE_START======================================================= @@ -35,6 +35,7 @@ import org.onap.vid.category.AddCategoryOptionResponse; import org.onap.vid.category.AddCategoryOptionsRequest; import org.onap.vid.category.CategoryParameterOptionRep; import org.onap.vid.category.CategoryParametersResponse; +import org.onap.vid.controller.open.MaintenanceController; import org.onap.vid.model.CategoryParameter; import org.onap.vid.model.CategoryParameterOption; import org.onap.vid.services.CategoryParameterService; diff --git a/vid-app-common/src/test/java/org/onap/vid/controller/RoleGeneratorControllerTest.java b/vid-app-common/src/test/java/org/onap/vid/controller/open/RoleGeneratorControllerTest.java index c5b4a55dc..c1509d956 100644 --- a/vid-app-common/src/test/java/org/onap/vid/controller/RoleGeneratorControllerTest.java +++ b/vid-app-common/src/test/java/org/onap/vid/controller/open/RoleGeneratorControllerTest.java @@ -19,7 +19,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.vid.controller; +package org.onap.vid.controller.open; import static org.mockito.BDDMockito.given; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; @@ -32,6 +32,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.runners.MockitoJUnitRunner; +import org.onap.vid.controller.open.RoleGeneratorController; import org.onap.vid.services.RoleGeneratorService; import org.springframework.http.MediaType; import org.springframework.test.web.servlet.MockMvc; diff --git a/vid-app-common/src/test/java/org/onap/vid/controller/VersionControllerTest.java b/vid-app-common/src/test/java/org/onap/vid/controller/open/VersionControllerTest.java index f92a26ea7..835ea4a66 100644 --- a/vid-app-common/src/test/java/org/onap/vid/controller/VersionControllerTest.java +++ b/vid-app-common/src/test/java/org/onap/vid/controller/open/VersionControllerTest.java @@ -18,8 +18,9 @@ * ============LICENSE_END========================================================= */ -package org.onap.vid.controller; +package org.onap.vid.controller.open; +import org.onap.vid.controller.open.VersionController; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; |