diff --git a/restful-web-service/pom.xml b/restful-web-service/pom.xml index 8e452e7d..4693de66 100644 --- a/restful-web-service/pom.xml +++ b/restful-web-service/pom.xml @@ -62,6 +62,11 @@ jackson-dataformat-xml 2.10.2 + + io.springfox + springfox-boot-starter + 3.0.0 + diff --git a/restful-web-service/src/main/java/com/example/restfulwebservice/config/SwaggerConfig.java b/restful-web-service/src/main/java/com/example/restfulwebservice/config/SwaggerConfig.java new file mode 100644 index 00000000..fe73051b --- /dev/null +++ b/restful-web-service/src/main/java/com/example/restfulwebservice/config/SwaggerConfig.java @@ -0,0 +1,17 @@ +package com.example.restfulwebservice.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +@Configuration +@EnableSwagger2 +public class SwaggerConfig { + + @Bean + public Docket api() { + return new Docket(DocumentationType.SWAGGER_2); + } +}