Gyuseok
Dreaming_developer
Gyuseok
  • 분류 전체보기 (39)
    • Note (0)
    • TIL (8)
    • 일상 (1)
    • git & git hub (1)
    • Algorithm (14)
    • JAVA (5)
    • Spring & SpringBoot (10)
    • 기업연계 프로젝트 (0)

블로그 메뉴

  • 홈
  • 태그
  • 방명록
  • 관리자
  • 티스토리
  • 글작성

공지사항

인기 글

태그

  • Builder
  • 개발자취업부트캠프
  • 내일배움카드
  • lombok
  • 메가바이트스쿨
  • java
  • 국비지원교육
  • MegabyteSchool
  • pattern
  • 패스트캠퍼스

최근 댓글

최근 글

티스토리

hELLO · Designed By 정상우.
Gyuseok

Dreaming_developer

Spring & SpringBoot

SpringBoot Swagger UI사용하기

2022. 12. 19. 21:51

Swagger UI란?

Swagger UI allows anyone — be it your development team or your end consumers — to visualize and interact with the API’s resources without having any of the implementation logic in place. It’s automatically generated from your OpenAPI (formerly known as Swagger) Specification, with the visual documentation making it easy for back end implementation and client side consumption.

 

Swagger UI를 사용하면 개발 팀이든 엔드 유저든 누구나 구현 로직 없이도 API 리소스를 시각화하고 상호 작용할 수 있도록 도와준다.

Swagger는 OpenAPI (이전 Swagger) 사양으로 자동 생성되며 시각적 문서를 통해 백엔드 구현 및 클라이언트 측 사용을 쉽게 할 수 있게 한다.

Swagger UI를 적용하면 별도의 코드 추가 없이도 OpenAPI 규격에 맞게 API를 자동으로 시각화 시켜 줄 수 있다.

 

Swagger UI 사용방법

1.dependencies 추가

implementation group: 'io.springfox', name: 'springfox-swagger2', version: '2.9.2'
implementation group: 'io.springfox', name: 'springfox-swagger-ui', version: '2.9.2'

2.application.properties 추가

spring.mvc.pathmatch.matching-strategy=ant_path_matcher

 

3.자바 config 파일 추가

@Configuration
@EnableSwagger2
public class SwaggerConfig {

    @Bean
    public Docket api(){
        return new Docket(DocumentationType.SWAGGER_2);
    }
}

4.URL접속

http://localhost:8080/swagger-ui.html#/

 

'Spring & SpringBoot' 카테고리의 다른 글

MockMVC  (0) 2023.01.13
SpringBoot JPA 사용하기  (0) 2022.12.30
Spring AOP  (0) 2022.12.16
SpringBoot 이전 페이지 URL가져오기  (0) 2022.12.09
Spring Boot에서 MariaDB 와 MyBatis를 적용해보기  (0) 2022.11.30
    'Spring & SpringBoot' 카테고리의 다른 글
    • MockMVC
    • SpringBoot JPA 사용하기
    • Spring AOP
    • SpringBoot 이전 페이지 URL가져오기
    Gyuseok
    Gyuseok

    티스토리툴바