[Spring] Spring Boot로 ToDoApp만들기(투두 앱) (4) - final

728x90

Swagger 도입

  • Api Test, 설명UI 깔끔
    build.gradle에 추가
implementation("io.springfox:springfox-swagger2:2.9.2")
implementation("io.springfox:springfox-swagger-ui:2.9.2")

 


SwaggerConfig

@Configuration
@EnableSwagger2
class SwaggerConfig {

    @Bean
    fun docket(): Docket {

        return Docket(DocumentationType.SWAGGER_2)
            .select()
            .apis(RequestHandlerSelectors.any())
            .paths(PathSelectors.any())
            .build()
    }
}

 

  • 위와 같이 설명, UI 관련 어노테이션 사용 할 수 있다.

728x90

댓글

Designed by JB FACTORY