Skip to content

Commit

Permalink
feat: swagger 서버 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
yeop0740 committed Nov 19, 2023
1 parent 695d1bf commit a55912d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main/java/com/backend/config/SwaggerConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,28 @@
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.media.Schema;
import io.swagger.v3.oas.models.security.SecurityScheme;
import io.swagger.v3.oas.models.servers.Server;
import org.springdoc.core.utils.SpringDocUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.util.List;

import static org.springdoc.core.utils.Constants.DEFAULT_SERVER_DESCRIPTION;

@Configuration
public class SwaggerConfig {

@Value("${swagger.request-server}")
private String SERVER_BASE_URL;

@Bean
public OpenAPI openAPI() {
return new OpenAPI()
.servers(List.of(new Server().url(SERVER_BASE_URL).description(DEFAULT_SERVER_DESCRIPTION)))
.components(new Components()
.addSecuritySchemes("bearer-key",
new SecurityScheme().type(SecurityScheme.Type.HTTP).scheme("bearer").bearerFormat("JWT")))
Expand Down

0 comments on commit a55912d

Please sign in to comment.