aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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();
}