SwaggerConfig ( 스프링부트 2버전 )
페이지 정보
본문
package web.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
@Configuration
public class SwaggerConfig {
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("프로젝트 Swagger")
.build();
}
@Bean
public Docket api() {
return new Docket(DocumentationType.OAS_30)
.useDefaultResponseMessages(false)
.select()
.apis(RequestHandlerSelectors.basePackage("web.controller"))
.paths(PathSelectors.any())
.build()
.apiInfo(apiInfo());
}
}
- 이전글build.gradle ( swagger-ui ) 24.06.19
- 다음글SwaggerConfig ( 스프링부트 3버전 ) 24.06.19
댓글목록
등록된 댓글이 없습니다.