summaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main/java
diff options
context:
space:
mode:
authorWojciech Sliwka <wojciech.sliwka@nokia.com>2019-04-09 14:57:02 +0200
committerWojciech Sliwka <wojciech.sliwka@nokia.com>2019-04-09 14:57:02 +0200
commit86683c58addadfeabe12d10c2fa26cfead22c2fe (patch)
tree12b8eb0918439c87145d112c1cf05593cc85f3b5 /vid-app-common/src/main/java
parent2e77a83940fbe63305045ae8712404e38e8be185 (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/main/java')
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/controller/WebConfig.java15
-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
5 files changed, 20 insertions, 4 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;