package uk.ac.ebi.quickgo.rest.controller;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
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;

/**
 * Reusable REST API documentation provider. This configuration can
 * be imported by a REST application, in order for its end-points to be
 * auto-documented.
 *
 * Created 13/04/16
 * @author Edd
 */
@Configuration
@EnableSwagger2
public class SwaggerConfig {
    @Bean
    public Docket api() {
        return new Docket(DocumentationType.SWAGGER_2)
                .select()
                .apis(RequestHandlerSelectors.any())
                .paths(PathSelectors.any())
                .build();
    }
}

@@ -37,16 +37,58 @@
 oller;%0A%0A
+import com.google.common.base.Predicates;%0A
 import o
@@ -896,42 +896,218 @@
     
-.apis(RequestHandlerSelectors.any(
+// exclude any spring boot's default APIs e.g., /error:%0A                //   we only want our APIs documented%0A                .apis(Predicates.not(RequestHandlerSelectors.basePackage(%22org.springframework.boot%22)
 ))%0A 

exclude spring boot's default REST API documentation for /error https://github.com/springfox/springfox/issues/631