aboutsummaryrefslogtreecommitdiffstats
path: root/datafile-app-server
diff options
context:
space:
mode:
authorTamasBakai <tamas.bakai@est.tech>2019-04-25 08:47:13 +0000
committerTamasBakai <tamas.bakai@est.tech>2019-04-25 08:47:13 +0000
commit7fcb32ce4495d15bbf068094610e2da0414ba7cd (patch)
tree0b1b9e83b4c31225829de9e9d589e128e9cb5bbe /datafile-app-server
parent30fe09bd17f6cea12e01bc3834ca4bca581a3d7d (diff)
Extend Swagger for actuator end-points also1.1.21.1.1
Change-Id: Ia036f7d79d25ceb2f1e465d79f17db1acbabbfbf Issue-ID: DCAEGEN2-1443 Signed-off-by: TamasBakai <tamas.bakai@est.tech>
Diffstat (limited to 'datafile-app-server')
-rw-r--r--datafile-app-server/src/main/java/org/onap/dcaegen2/collectors/datafile/configuration/SwaggerConfig.java22
1 files changed, 12 insertions, 10 deletions
diff --git a/datafile-app-server/src/main/java/org/onap/dcaegen2/collectors/datafile/configuration/SwaggerConfig.java b/datafile-app-server/src/main/java/org/onap/dcaegen2/collectors/datafile/configuration/SwaggerConfig.java
index 7fb1ba72..71242265 100644
--- a/datafile-app-server/src/main/java/org/onap/dcaegen2/collectors/datafile/configuration/SwaggerConfig.java
+++ b/datafile-app-server/src/main/java/org/onap/dcaegen2/collectors/datafile/configuration/SwaggerConfig.java
@@ -18,6 +18,7 @@
package org.onap.dcaegen2.collectors.datafile.configuration;
+import com.google.common.base.Predicates;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
@@ -36,15 +37,13 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
@Configuration
@Profile("prod")
public class SwaggerConfig extends WebMvcConfigurationSupport {
-
- public static final String PACKAGE_PATH = "org.onap.dcaegen2.collectors.datafile";
- public static final String API_TITLE = "DATAFILE app server";
- public static final String DESCRIPTION = "This page lists all the rest apis for DATAFILE app server.";
- public static final String VERSION = "1.0";
- public static final String RESOURCES_PATH = "classpath:/META-INF/resources/";
- public static final String WEBJARS_PATH = RESOURCES_PATH + "webjars/";
- public static final String SWAGGER_UI = "swagger-ui.html";
- public static final String WEBJARS = "/webjars/**";
+ static final String API_TITLE = "DATAFILE app server";
+ static final String DESCRIPTION = "This page lists all the rest apis for DATAFILE app server.";
+ static final String VERSION = "1.0";
+ static final String RESOURCES_PATH = "classpath:/META-INF/resources/";
+ static final String WEBJARS_PATH = RESOURCES_PATH + "webjars/";
+ static final String SWAGGER_UI = "swagger-ui.html";
+ static final String WEBJARS = "/webjars/**";
/**
* Gets the API info.
@@ -55,8 +54,11 @@ public class SwaggerConfig extends WebMvcConfigurationSupport {
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2) //
.apiInfo(apiInfo()) //
- .select().apis(RequestHandlerSelectors.basePackage(PACKAGE_PATH)) //
+ .select() //
+ .apis(RequestHandlerSelectors.any()) //
.paths(PathSelectors.any()) //
+ .paths(Predicates.not(PathSelectors.regex("/error"))) //
+ // this endpoint is not implemented, but was visible for Swagger
.build();
}