From 4b3a78eb871d660de318cac206d5f801fd98f019 Mon Sep 17 00:00:00 2001 From: tfer2442 Date: Sun, 8 Sep 2024 22:59:24 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20=EC=9A=B4=EC=98=81=20=ED=99=98?= =?UTF-8?q?=EA=B2=BD=20=EC=8A=A4=EC=9B=A8=EA=B1=B0=20=EC=A0=9C=EC=99=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/haedal/haedalweb/config/SwaggerConfig.java | 8 +------- src/main/resources/application.properties | 3 ++- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/haedal/haedalweb/config/SwaggerConfig.java b/src/main/java/com/haedal/haedalweb/config/SwaggerConfig.java index 1f238ff..58bae97 100644 --- a/src/main/java/com/haedal/haedalweb/config/SwaggerConfig.java +++ b/src/main/java/com/haedal/haedalweb/config/SwaggerConfig.java @@ -23,14 +23,12 @@ import io.swagger.v3.oas.models.security.SecurityRequirement; import io.swagger.v3.oas.models.security.SecurityScheme; import org.springdoc.core.customizers.OperationCustomizer; -import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; import org.springframework.http.HttpHeaders; import org.springframework.validation.FieldError; import org.springframework.web.method.HandlerMethod; - import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -47,14 +45,10 @@ @Configuration public class SwaggerConfig { private static final String BEARER_TOKEN_PREFIX = "Bearer"; - private static boolean swaggerEnabled = false; @Bean + @Profile("!prod") public OpenAPI openAPI() { - if (!swaggerEnabled) { - return null; - } - String accessToken = "Access Token (Bearer)"; SecurityRequirement securityRequirement = new SecurityRequirement() diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 27accf6..009f958 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1 +1,2 @@ -spring.profiles.include=db, jwt, aws \ No newline at end of file +spring.profiles.include=db, jwt, aws +spring.profiles.active=prod