title: Swagger REST API documentation with Spring Boot
body: <p>I want to use Swagger 2.0 with my Spring Boot RESTful web service to generate documentation.  I have searched quite a bit for an answer to this.  Basically I have a Spring Boot project with a set of controllers and I want to document the API's.  I have the following dependencies setup in my POM file. </p>
  
  <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.4.0&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.5.0&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>This is my Swagger configuration class with the @Configuration and @EnableSwagger2:</p>
  
  <pre><code>      @Configuration
        @EnableSwagger2
  public class SwaggerConfig {
  
      @Bean
      public Docket api(){
          return new Docket(DocumentationType.SWAGGER_2)
              .select()
              .apis(RequestHandlerSelectors.any())
              .paths(PathSelectors.regex("/api/.*"))
              .build()
              .apiInfo(apiInfo());
      }
  
      private ApiInfo apiInfo() {
          return new ApiInfoBuilder()
              .title("My application title")
              .description("This is a test of documenting EST API's")
              .version("V1.2")
              .termsOfServiceUrl("http://terms-of-services.url")
              .license("LICENSE")
              .licenseUrl("http://url-to-license.com")
              .build();
      }
  
  }
  </code></pre>
  
  <p>From what I have gathered in reading a couple of other answers here that at this point I should be able to see something at a URL such as <a href="http://myapp/v2/api-docs" rel="nofollow noreferrer">http://myapp/v2/api-docs</a> or alternatively <a href="http://localhost:8080/myapp/api-docs" rel="nofollow noreferrer">http://localhost:8080/myapp/api-docs</a>  I have made the assumption that the "myapp" portion of the above URL refers to the name of the class in which my main resides (is this correct)?  Also I have tried this with port 8080 and port 80 and the bottom line is that I see nothing other than site can't be reached.  I have looked at the answers provided <a href="https://stackoverflow.com/questions/26720090/a-simple-way-to-implement-swagger-in-a-spring-mvc-application">here</a> and <a href="https://stackoverflow.com/questions/26807791/swagger-for-spring-mvc-project">here</a> however I'm not having any success.  Any help would be much appreciated, thank you in advance.</p>