Skip to content

Commit

Permalink
Merge pull request #83 from Unithon11th-Team5/setting/#80
Browse files Browse the repository at this point in the history
setting: add bearer header to swagger config
  • Loading branch information
chominho96 authored Apr 6, 2024
2 parents 15df9ab + b790920 commit 17839fa
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/main/java/unithon/uniletter/config/SwaggerConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
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.SecurityScheme;
import io.swagger.v3.oas.models.servers.Server;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand All @@ -12,13 +13,22 @@ public class SwaggerConfig {

@Bean
public OpenAPI openAPI() {

return new OpenAPI()
.components(new Components())
.addServersItem(new Server().url("/"))
.info(getPayoutServerInfo());
.info(getUniletterServerInfo())
.components(
new Components().addSecuritySchemes(
"oauth2 token",
new SecurityScheme()
.scheme("bearer")
.type(SecurityScheme.Type.HTTP)
.bearerFormat("jwt")
.name("oauth2")
));
}

private Info getPayoutServerInfo() {
private Info getUniletterServerInfo() {
return new Info().title("Uniletter Server API")
.description("Uniletter Server API 명세서입니다.")
.version("1.0.0");
Expand Down

0 comments on commit 17839fa

Please sign in to comment.