Following the instructions here:
http://www.baeldung.com/swagger-2-documentation-for-spring-rest-api
I added these dependencies to my project:
For Spring Version >= 2.2, you should add the dependency springfox-boot-starter
pom.xml:
1.8
3.0.0
io.springfox
springfox-swagger2
${io.springfox.version}
io.springfox
springfox-swagger-ui
${io.springfox.version}
io.springfox
springfox-data-rest
${io.springfox.version}
io.springfox
springfox-bean-validators
${io.springfox.version}
io.springfox
springfox-boot-starter
${io.springfox.version}
ApplicationSwaggerConfig
@Configuration
@EnableSwagger2
public class ApplicationSwaggerConfig {
@Bean
public Docket employeeApi() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.any())
.paths(PathSelectors.any())
.build();
}
}
Swagger-UI link: http://localhost:8080/swagger-ui/index.html#/