I have RESTful
web service which I have developed in spring boot. I have integrated the swagger2
in my application using Gradle
build tool.
testCompile('io.springfox:springfox-swagger2:2.6.1')
testCompile('io.springfox:springfox-swagger-ui:2.6.1')
I wrote the configuration file for swagger2
in following way
@Configuration
@EnableSwagger2
public class SwaggerConfig {
@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2)
.select().apis(RequestHandlerSelectors.basePackage("com.example.restdemo.web"))
.paths(PathSelectors.any())
.build();
}
}
Now when I try to access the http://localhost:8080/v2/api-docs
I am getting the JSON
string. But when I am trying to access the http://localhost:8080/swagger-ui.html
I am not getting Swagger UI view, I am getting the 406
error.