Skip to content

Commit

Permalink
feat: swagger 설정을 위한 configuration 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
xyzwv committed Mar 16, 2024
1 parent 9d68aeb commit 459bf99
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions src/main/java/EBus/EBusback/global/config/SwaggerConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package EBus.EBusback.global.config;

import java.util.Collections;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import io.swagger.v3.oas.models.Components;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.security.SecurityRequirement;
import io.swagger.v3.oas.models.security.SecurityScheme;

@Configuration
public class SwaggerConfig {

@Bean
public OpenAPI openApi() {
return new OpenAPI()
.info(new Info()
.title("E-BUS API Documentation")
.description(
"2024 EWHA-THON [E-BUS] by Team Kim2leesongcha")
.version("0.0.1"))
.components(new Components()
.addSecuritySchemes("authorization",
new SecurityScheme()
.type(SecurityScheme.Type.HTTP)
.in(SecurityScheme.In.HEADER)
.scheme("Bearer")
.bearerFormat("JWT")))
.security(Collections.singletonList(
new SecurityRequirement().addList("authorization")));
}
}

0 comments on commit 459bf99

Please sign in to comment.