
Assignees : 누구에게 할당 될 업무인지
Labels : 어느 종류의 라벨인지 선택
Deployment : 여기서 새로운 브랜치를 팔 수도 있고 기존 브랜치도 선택 가능
업무종류/이슈번호 방법이 있다.API 테스트 툴에는 postman, swagger등이 있고, umc 워크북에서는 swagger에 대해 다룬다.
build.gradle
implementation 'org.springdoc:springdoc-openapi-ui:1.6.15'
implementation 'io.springfox:springfox-swagger2:2.9.2'
implementation 'io.springfox:springfox-swagger-ui:2.9.2'
SwaggerConfig
@Configuration
public class SwaggerConfig {
@Bean
public OpenAPI UMCstudyAPI() {
Info info = new Info()
.title("UMC Server WorkBook API")
.description("UMC Server WorkBook API 명세서")
.version("1.0.0");
String jwtSchemeName = "JWT TOKEN";
// API 요청헤더에 인증정보 포함
SecurityRequirement securityRequirement = new SecurityRequirement().addList(jwtSchemeName);
// SecuritySchemes 등록
Components components = new Components()
.addSecuritySchemes(jwtSchemeName, new SecurityScheme()
.name(jwtSchemeName)
.type(SecurityScheme.Type.HTTP) // HTTP 방식
.scheme("bearer")
.bearerFormat("JWT"));
return new OpenAPI()
.addServersItem(new Server().url("/"))
.info(info)
.addSecurityItem(securityRequirement)
.components(components);
}
}
http://localhost:8080/swagger-ui/index.html#/
처럼 /swagger-ui/index.html#/ 이 주소를 서버 주소 뒤에 붙이면 접속 할 수 있다.