티스토리 뷰
공부 (@Deprecated)
[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
'공부 (@Deprecated)' 카테고리의 다른 글
| [Java] StringEscapeUtils.escapeJava(str); (0) | 2022.01.14 |
|---|---|
| [Oracle] char, varchar, varchar2 (0) | 2022.01.14 |
| [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
- Today
- Yesterday
TAG
- Kluge
- 메디파크 내과 전문의 의학박사 김영수
- 테슬라 리퍼럴 코드 혜택
- 테슬라 추천
- 테슬라 레퍼럴 적용 확인
- 팔로워 수 세기
- 테슬라 레퍼럴 코드 확인
- Bot
- 모델y
- 테슬라 리퍼럴 코드
- 클루지
- wlw
- 책그림
- 어떻게 능력을 보여줄 것인가?
- 김달
- 레퍼럴
- follower
- 테슬라 레퍼럴
- 모델 Y 레퍼럴
- 인스타그램
- COUNT
- 테슬라 크레딧 사용
- 테슬라
- 연애학개론
- 유투브
- 테슬라 리퍼럴 코드 생성
- 할인
- 개리마커스
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | 29 | 30 | 31 |
글 보관함