Merge branch 'be/fix/swagger-https' into 'be/develop'
Fix: Swagger 요청 실패 에러 해결 - S11P21S002-188 See merge request s11-s-project/S11P21S002!88
This commit is contained in:
commit
53a455fc5f
@ -5,6 +5,8 @@ import io.swagger.v3.oas.annotations.enums.SecuritySchemeIn;
|
||||
import io.swagger.v3.oas.annotations.enums.SecuritySchemeType;
|
||||
import io.swagger.v3.oas.annotations.info.Info;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityScheme;
|
||||
import io.swagger.v3.oas.annotations.servers.Server;
|
||||
import io.swagger.v3.oas.models.security.SecurityRequirement;
|
||||
import org.springdoc.core.customizers.OperationCustomizer;
|
||||
import org.springdoc.core.models.GroupedOpenApi;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
@ -16,7 +18,11 @@ import org.springframework.context.annotation.Configuration;
|
||||
title = "auto labeling API",
|
||||
description = "auto labeling API 목록입니다.",
|
||||
version = "v1.0"
|
||||
)
|
||||
),
|
||||
servers = {
|
||||
@Server(url = "https://worlabel.site", description = "Worlabel Server URL"),
|
||||
@Server(url = "https://j11s002.p.ssafy.io", description = "J11S002 Server URL")
|
||||
}
|
||||
)
|
||||
@SecurityScheme(
|
||||
name = "Authorization",
|
||||
@ -51,8 +57,9 @@ public class SwaggerConfig {
|
||||
return GroupedOpenApi.builder()
|
||||
.group("token 필요 API")
|
||||
.pathsToExclude(noRequiredTokenApi)
|
||||
.addOperationCustomizer(operationCustomizer)
|
||||
.addOperationCustomizer((operation, handlerMethod) ->
|
||||
operation.addSecurityItem(new SecurityRequirement().addList("Authorization"))
|
||||
)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user