From 7fcb32ce4495d15bbf068094610e2da0414ba7cd Mon Sep 17 00:00:00 2001 From: TamasBakai Date: Thu, 25 Apr 2019 08:47:13 +0000 Subject: Extend Swagger for actuator end-points also Change-Id: Ia036f7d79d25ceb2f1e465d79f17db1acbabbfbf Issue-ID: DCAEGEN2-1443 Signed-off-by: TamasBakai --- .../datafile/configuration/SwaggerConfig.java | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'datafile-app-server') 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(); } -- cgit 1.2.3-korg