- dependency 추가 (gradle 기준)
dependencies { ... implementation "io.springfox:springfox-boot-starter:3.0.0" compile 'io.springfox:springfox-swagger-ui:3.0.0' } |
- 설정파일 추가 (SwaggerConfig.java)
@Configuration public class SwaggerConfig { @Bean public Docket api() { return new Docket(DocumentationType.OAS_30) // open api spec 3.0 .select() .apis(RequestHandlerSelectors.any()) .paths(PathSelectors.any()) .build(); } } |
- 검증
- http://localhost:8080/swagger-ui/index.html
- References
- 코드 참고: https://medium.com/@hala3k/setting-up-swagger-3-with-spring-boot-2-a7c1c3151545
- Swagger Reference 문서: https://springfox.github.io/springfox/docs/current/
- Springfox Github: https://github.com/springfox/springfox
- swagger 보안: github.com/springfox/springfox-oath2-demo
'IT > java' 카테고리의 다른 글
Lombok annotation 정리 (0) | 2021.10.21 |
---|---|
eclipse에서 svn offline 설치하기 (0) | 2020.04.28 |
Spring Boot study 메모 (0) | 2019.02.27 |
Restful API (0) | 2017.12.23 |
댓글