Skip to content

Commit

Permalink
Merge pull request #122 from Alpha-Damyo/develop
Browse files Browse the repository at this point in the history
Main Merge
  • Loading branch information
BlueBerrySoda authored Aug 13, 2024
2 parents 5afdfad + 3c28496 commit 6f7cc2a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/main/java/com/damyo/alpha/global/config/SwaggerConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@
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 org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.List;

@Configuration
public class SwaggerConfig {

@Value("${springdoc.swagger-ui.swg3-address}")
private String address;

@Bean
public OpenAPI openAPI() {
String jwt = "jwt";
Expand All @@ -24,10 +30,13 @@ public OpenAPI openAPI() {
.scheme("bearer")
.bearerFormat("token"));

Server server = new Server();
server.setUrl(address);

return new OpenAPI()
.addServersItem(new Server().url("/"))
.info(apiInfo())
.components(components);
.components(components)
.servers(List.of(server));
}

private Info apiInfo() {
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,6 @@ springdoc:
tags-sorter: alpha
operations-sorter: alpha
persist-authorization: true
swg3-address: ${SWG3_ADDRESS}
paths-to-match:
- /api/**

0 comments on commit 6f7cc2a

Please sign in to comment.