Skip to content

Commit

Permalink
Add swagger config
Browse files Browse the repository at this point in the history
  • Loading branch information
edysegura committed May 19, 2020
1 parent fa75f6d commit e850dd0
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/main/java/br/com/spring/restful/config/SwaggerConfig.java
Original file line number Diff line number Diff line change
@@ -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();
}
}

0 comments on commit e850dd0

Please sign in to comment.