From e850dd091190943237e9a672e8ce1f06c0c2b92e Mon Sep 17 00:00:00 2001 From: Edy Segura Date: Tue, 19 May 2020 12:22:51 -0300 Subject: [PATCH] Add swagger config --- .../spring/restful/config/SwaggerConfig.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/main/java/br/com/spring/restful/config/SwaggerConfig.java diff --git a/src/main/java/br/com/spring/restful/config/SwaggerConfig.java b/src/main/java/br/com/spring/restful/config/SwaggerConfig.java new file mode 100644 index 0000000..04f44a5 --- /dev/null +++ b/src/main/java/br/com/spring/restful/config/SwaggerConfig.java @@ -0,0 +1,23 @@ +package br.com.spring.restful.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import springfox.documentation.builders.PathSelectors; +import springfox.documentation.builders.RequestHandlerSelectors; +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) + .select() + .apis(RequestHandlerSelectors.any()) + .paths(PathSelectors.any()) + .build(); + } +} \ No newline at end of file