-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: swagger 설정을 위한 configuration 추가
- Loading branch information
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
src/main/java/EBus/EBusback/global/config/SwaggerConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"))); | ||
} | ||
} |