title: Swagger 2 Issue spring Boot
body: <p>I'm facing issue with Swagger Integration in Spring Boot. Have a look at the code and error snippet.</p>
  <p>------------------POM--------------------</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;properties&gt;
      &lt;java.version&gt;1.8&lt;/java.version&gt;
      &lt;swagger.version&gt;2.9.2&lt;/swagger.version&gt;
  &lt;/properties&gt;
  
  &lt;dependency&gt;
      &lt;groupId&gt;io.springfox&lt;/groupId&gt;
      &lt;artifactId&gt;springfox-swagger2&lt;/artifactId&gt;
      &lt;version&gt;${swagger.version}&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;${swagger.version}&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;io.springfox&lt;/groupId&gt;
      &lt;artifactId&gt;springfox-bean-validators&lt;/artifactId&gt;
      &lt;version&gt;${swagger.version}&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  <p>-----------------App class--------------</p>
  <pre class="lang-java prettyprint-override"><code>@SpringBootApplication
  @EnableSwagger2
  public class ProducerApplication {
  
    public static void main(String[] args) {
      SpringApplication.run(ServletPocProducerApplication.class, args);
    }
    
    @Bean 
    public Docket api() { 
      return new Docket(DocumentationType.SWAGGER_2)
        .select() 
        .apis(RequestHandlerSelectors.any())
        .paths(PathSelectors.any())
        .build();
    }
  }
  </code></pre>
  <p>Stack Trace</p>
  <pre><code>org.springframework.context.ApplicationContextException: Failed to start bean 
  'documentationPluginsBootstrapper'; nested exception is 
   java.lang.NullPointerException: Cannot invoke 
  &quot;org.springframework.web.servlet.mvc.condition.PatternsRequestCondition.toString()&quot; 
  because the return value of 
  &quot;springfox.documentation.spi.service.contexts.Orderings.patternsCondition(springfox.docume 
  ntation.RequestHandler)&quot; is null
     at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:181) ~[spring-context-5.3.13.jar:5.3.13]
  </code></pre>
  <p>How do I fix this??</p>