title: Swagger not detecting Spring Data Rest APIs with Spring Boot
body: <p>I setup a Spring Boot project including Spring Data Rest and Swagger:</p>
  
  <pre><code>&lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-data-rest&lt;/artifactId&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
          &lt;groupId&gt;io.springfox&lt;/groupId&gt;
          &lt;artifactId&gt;springfox-swagger2&lt;/artifactId&gt;
          &lt;version&gt;2.4.0&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
          &lt;groupId&gt;io.springfox&lt;/groupId&gt;
          &lt;artifactId&gt;springfox-swagger-ui&lt;/artifactId&gt;
          &lt;version&gt;2.4.0&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>This is my Swagger configuration:</p>
  
  <pre><code>@Configuration
  @EnableSwagger2
  public class SwaggerConfig {
      @Bean
      public Docket api() {
          return new Docket(DocumentationType.SWAGGER_2)
                  .select()
                  .apis(RequestHandlerSelectors.any())
                  .paths(PathSelectors.any())
                  .build();
      }
  }
  </code></pre>
  
  <p>Excerpt from application.properties:</p>
  
  <pre><code>spring.data.rest.base-path=/api
  server.context-path=/myapp
  </code></pre>
  
  <p>When I run the server, all rest endpoints are correctly mapped and reachable to <code>/myapp/api/...</code>, including a custom RestController I created on my own. </p>
  
  <p>However:</p>
  
  <ul>
  <li><p>at <code>http://localhost:8080/myapp/api</code> I can see the list of Spring
  Data Rest APIs (in Json format) but cannot see my custom RestController endpoints.</p></li>
  <li><p>at <code>http://localhost:8080/myapp/swagger-ui.html</code> I see a nice gui which only lists my custom RestController and the error endpoint, not the Spring Data Rest APIs. In fact, <a href="http://localhost:8080/myapp/v2/api-docs" rel="noreferrer">http://localhost:8080/myapp/v2/api-docs</a> does not make any reference to Spring Data Rest endpoints, but only to my custom RestController and to the error endpoint.</p></li>
  </ul>
  
  <p>How can I fix my Spring Data Rest &amp; Swagger configuration?</p>