Skip to content

Commit

Permalink
feat: 스웨거 API 요청 시 엑세스 토큰 헤더에 포함되도록 설정 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
uwoobeat committed Jan 31, 2024
1 parent 6d5f833 commit 197be9d
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
import io.swagger.v3.oas.models.security.SecurityRequirement;
import io.swagger.v3.oas.models.security.SecurityScheme;
import io.swagger.v3.oas.models.security.SecurityScheme.In;
import io.swagger.v3.oas.models.security.SecurityScheme.Type;
Expand Down Expand Up @@ -37,6 +38,7 @@ public class SwaggerConfig {
public OpenAPI openAPI() {
return new OpenAPI()
.servers(swaggerServers())
.addSecurityItem(securityRequirement())
.components(authSetting())
.info(swaggerInfo());
}
Expand Down Expand Up @@ -81,6 +83,12 @@ private Info swaggerInfo() {
.license(license);
}

private SecurityRequirement securityRequirement() {
SecurityRequirement securityRequirement = new SecurityRequirement();
securityRequirement.addList("accessToken");
return securityRequirement;
}

@Bean
public ModelResolver modelResolver(ObjectMapper objectMapper) {
// 객체 직렬화
Expand Down

0 comments on commit 197be9d

Please sign in to comment.