diff --git a/backend/src/main/java/com/worlabel/global/config/SwaggerConfig.java b/backend/src/main/java/com/worlabel/global/config/SwaggerConfig.java index 1f48168..f57d0ed 100644 --- a/backend/src/main/java/com/worlabel/global/config/SwaggerConfig.java +++ b/backend/src/main/java/com/worlabel/global/config/SwaggerConfig.java @@ -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(); } } -