title: Issues in Enabling the swagger 2 in Spring Boot java application
body: <p>I hope you are all doing well. I am trying to enable the swagger in my spring boot and somehow I can not get it working. I took all the steps which I should have, it is really frustrating now to stick at it for a day. Here are the details.</p>
  <ol>
  <li>Added Dependencies</li>
  </ol>
  <pre><code>&lt;dependency&gt;
             &lt;groupId&gt;io.springfox&lt;/groupId&gt;
             &lt;artifactId&gt;springfox-swagger-ui&lt;/artifactId&gt;
             &lt;version&gt;2.9.2&lt;/version&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.9.2&lt;/version&gt;
         &lt;/dependency&gt;
  </code></pre>
  <ol start="2">
  <li>Enable the swagger annotation</li>
  </ol>
  <pre><code>@EnableSwagger2
  </code></pre>
  <ol start="3">
  <li>Create a bean with Docket Object to scan</li>
  </ol>
  <pre><code>@Bean
      public Docket swaggerApi() {
          return new Docket(DocumentationType.SWAGGER_2)
                  .select()
                  .apis(RequestHandlerSelectors.basePackage(&quot;ml.XXXXXXXX&quot;))
                  .paths(PathSelectors.any())
                  .build()
                  .apiInfo(new ApiInfoBuilder().version(&quot;v1&quot;)
                          .title(&quot;Account Service API&quot;)
                          .description(&quot;Documentation Account Service API v1&quot;).build());
      }
  </code></pre>
  <p>My servlet context path is</p>
  <pre><code>server:
    servlet:
      context-path: /account
  
  </code></pre>
  <p>I have tried every possible URL of swagger like <code>http://localhost:8080/swagger-ui.html</code>, <code>http://localhost:8080/account/swagger-ui.html</code>, <code>http://localhost:8080/account/v2/api-docs</code>. None of this is working. Could you please let me know if I am missing anything or doing wrong. I would really appreciate it.</p>
  <p>Thanks ~~</p>