Skip to content

Commit

Permalink
[BUG] Swagger CORS 오류 (#140)
Browse files Browse the repository at this point in the history
* fix: Swagger CORS 오류 (#139)

* test: Swagger CORS 오류 (#139)

* fix: Swagger CORS 오류 해결 (#139)
  • Loading branch information
hyunmin0317 authored Jan 1, 2025
1 parent 393674d commit 406e9a3
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.security.SecurityRequirement;
import io.swagger.v3.oas.models.security.SecurityScheme;
import io.swagger.v3.oas.models.servers.Server;
import lombok.RequiredArgsConstructor;
import org.springframework.boot.info.GitProperties;
import org.springframework.context.annotation.Bean;
Expand All @@ -20,6 +21,7 @@ public class SwaggerConfig {
public OpenAPI openAPI() {
return new OpenAPI()
.info(info())
.addServersItem(new Server().url("/"))
.components(new Components().addSecuritySchemes("access-token", securityScheme()))
.addSecurityItem(new SecurityRequirement().addList("access-token"));
}
Expand Down

0 comments on commit 406e9a3

Please sign in to comment.