티스토리 뷰
공부
[Spring Boot] How to fully disable swagger-ui in spring-boot?(/swagger-ui.html should return 404)
승가비 2022. 1. 12. 13:38728x90
@Profile(value = {"swagger"})
@Configuration
@EnableSwagger2
public class SwaggerConfiguration {
...
}
import org.apache.commons.lang3.StringUtils;
import org.springframework.context.annotation.Profile;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
@Profile("!local")
@Controller
public class SwaggerUiController {
@GetMapping(value = "swagger-ui.html")
public ResponseEntity disable() {
return new ResponseEntity<>(StringUtils.EMPTY, HttpStatus.NOT_FOUND);
}
}
How to fully disable swagger-ui in spring-boot?(/swagger-ui.html should return 404)
I have read following topic: Disabling Swagger with Spring MVC and I wrote: @Bean public Docket api() { return new Docket(DocumentationType.SWAGGER_2) .select() .apis(
stackoverflow.com
728x90
'공부' 카테고리의 다른 글
[Java] StringEscapeUtils.escapeJava(str); (0) | 2022.01.14 |
---|---|
[Oracle] char, varchar, varchar2 (0) | 2022.01.14 |
[Spring Boot] How to fully disable swagger-ui in spring-boot?(/swagger-ui.html should return 404) (0) | 2022.01.12 |
[Mac] MySQL (brew install mysql; mysql.server start) (0) | 2022.01.10 |
[Java] MySQL if check exists table (0) | 2022.01.10 |
[Java] MySQL select value (0) | 2022.01.10 |
댓글
250x250
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- 142,683
- Today
- 9
- Yesterday
- 219
TAG
- 김달
- 유투브
- wlw
- 메디파크 내과 전문의 의학박사 김영수
- 어떻게 능력을 보여줄 것인가?
- follower
- COUNT
- 개리마커스
- 인스타그램
- 클루지
- 연애학개론
- Kluge
- Bot
- 책그림
- 팔로워 수 세기