METRON-1398 Exclude the basic-error-controller from being added to the swagger 
description (MohanDV via merrimanr) closes apache/metron#898


Project: http://git-wip-us.apache.org/repos/asf/metron/repo
Commit: http://git-wip-us.apache.org/repos/asf/metron/commit/92c2e22e
Tree: http://git-wip-us.apache.org/repos/asf/metron/tree/92c2e22e
Diff: http://git-wip-us.apache.org/repos/asf/metron/diff/92c2e22e

Branch: refs/heads/feature/METRON-1344-test-infrastructure
Commit: 92c2e22e6cd50c122c9da1e8f6190a812eb01efb
Parents: a421df2
Author: MohanDV <mohan...@gmail.com>
Authored: Fri Jan 26 08:23:24 2018 -0600
Committer: merrimanr <merrim...@apache.org>
Committed: Fri Jan 26 08:23:24 2018 -0600

----------------------------------------------------------------------
 .../main/java/org/apache/metron/rest/config/SwaggerConfig.java    | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/metron/blob/92c2e22e/metron-interface/metron-rest/src/main/java/org/apache/metron/rest/config/SwaggerConfig.java
----------------------------------------------------------------------
diff --git 
a/metron-interface/metron-rest/src/main/java/org/apache/metron/rest/config/SwaggerConfig.java
 
b/metron-interface/metron-rest/src/main/java/org/apache/metron/rest/config/SwaggerConfig.java
index 9e82196..564ff32 100644
--- 
a/metron-interface/metron-rest/src/main/java/org/apache/metron/rest/config/SwaggerConfig.java
+++ 
b/metron-interface/metron-rest/src/main/java/org/apache/metron/rest/config/SwaggerConfig.java
@@ -19,6 +19,7 @@ package org.apache.metron.rest.config;
 
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
+import org.springframework.web.bind.annotation.RestController;
 import springfox.documentation.builders.PathSelectors;
 import springfox.documentation.builders.RequestHandlerSelectors;
 import springfox.documentation.spi.DocumentationType;
@@ -32,7 +33,7 @@ public class SwaggerConfig {
   public Docket api() {
     return new Docket(DocumentationType.SWAGGER_2)
             .select()
-            .apis(RequestHandlerSelectors.any())
+            
.apis(RequestHandlerSelectors.withClassAnnotation(RestController.class))
             .paths(PathSelectors.any())
             .build();
   }

Reply via email to