title: SWAGGER, @Configuration doesn't work with SpringFoxConfig
body: <p>I work with Spring boot framework, I try to comment on my APIs with Swagger but it doesn't work.
  I'm almost sure that the problem is in the SpringFoxConfig configuration class.</p>
  
  <pre><code>@EnableSwagger2
  @Configuration
  public class SwaggerConfig {
  
  
      @Bean
      public Docket productApi() {
          return new Docket(DocumentationType.SWAGGER_2)
                  .select()
                  .apis(RequestHandlerSelectors.basePackage("com.techprimers.springboot.swaggerexample"))
                  .paths(regex("/rest.*"))
                  .build()
                  .apiInfo(metaInfo());
      }
  
      private ApiInfo metaInfo() {
  
          ApiInfo apiInfo = new ApiInfo(
                  "Spring Boot Swagger Example API",
                  "Spring Boot Swagger Example API for Youtube",
                  "1.0",
                  "Terms of Service",
                  new Contact("TechPrimers", "https://www.youtube.com/TechPrimers",
                          "techprimerschannel@gmail.com"),
                  "Apache License Version 2.0",
                  "https://www.apache.org/licesen.html"
          );
  
          return apiInfo;
      }
  }
  </code></pre>
  
  <p>in my POM file:</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;io.springfox&lt;/groupId&gt;
      &lt;artifactId&gt;springfox-swagger2&lt;/artifactId&gt;
      &lt;version&gt;2.6.1&lt;/version&gt;
      &lt;scope&gt;compile&lt;/scope&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.6.1&lt;/version&gt;
      &lt;scope&gt;compile&lt;/scope&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>The program does not work and he shows me this <a href="https://i.stack.imgur.com/F2rUt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/F2rUt.png" alt="erreur"></a> when I run it with @Configuration but when I remove @Configuration it runs and when I type <a href="http://localhost:9080/swagger-ui.html" rel="nofollow noreferrer">http://localhost:9080/swagger-ui.html</a> it does not show me anything ( see the figure above) knowing that I want him to show me the information I wrote in the SpringFoxConfig class.</p>
  
  <p><a href="https://i.stack.imgur.com/F4O1j.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/F4O1j.png" alt="Swagger UI"></a>
  Do you have a solution or an explanation for my problem?</p>
  
  <p>Thank you.</p>