Skip to content

Commit 4c9ee72

Browse files
committed
♻️ chore: 스웨거 수정
1 parent e01b662 commit 4c9ee72

File tree

2 files changed

+20
-15
lines changed

2 files changed

+20
-15
lines changed
Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,35 @@
11
package com.api.advanced_mobile.global.config;
22

3-
import io.swagger.v3.oas.annotations.OpenAPIDefinition;
4-
import io.swagger.v3.oas.annotations.servers.Server;
5-
import io.swagger.v3.oas.models.Components;
63
import io.swagger.v3.oas.models.OpenAPI;
74
import io.swagger.v3.oas.models.info.Info;
5+
import io.swagger.v3.oas.models.servers.Server;
86
import org.springframework.context.annotation.Bean;
97
import org.springframework.context.annotation.Configuration;
108

9+
import java.util.List;
1110

12-
@OpenAPIDefinition(
13-
servers = {
14-
@Server(url = "https://api.13.209.194.63.nip.io", description = "https 서버입니다."),
15-
@Server(url = "http://api.13.209.194.63.nip.io", description = "http 서버입니다."),
16-
@Server(url = "http://localhost:8080", description = "local 서버입니다.")
17-
}
18-
)
1911
@Configuration
2012
public class SwaggerConfig {
2113

2214
@Bean
2315
public OpenAPI openAPI() {
16+
// HTTPS 서버만 명시
17+
Server httpsServer = new Server();
18+
httpsServer.setUrl("https://api.13.209.194.63.nip.io");
19+
httpsServer.setDescription("Production HTTPS Server");
20+
21+
// 로컬 서버 (개발용)
22+
Server localServer = new Server();
23+
localServer.setUrl("http://localhost:8080");
24+
localServer.setDescription("Local Development Server");
25+
2426
Info info = new Info()
2527
.title("API Document")
2628
.version("v0.0.1")
2729
.description("API 명세서입니다.");
2830

2931
return new OpenAPI()
3032
.info(info)
31-
.components(new Components());
33+
.servers(List.of(httpsServer, localServer));
3234
}
3335
}

src/main/resources/application.properties

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@ spring.jpa.open-in-view: false
1616
server.servlet.session.timeout=60m
1717

1818
#swagger
19-
springdoc.api-docs.path=/v3/api-docs
20-
springdoc.swagger-ui.path=/swagger-ui.html
21-
springdoc.swagger-ui.operationsSorter=method
22-
springdoc.swagger-ui.disable-swagger-default-url=true
19+
#springdoc.api-docs.path=/v3/api-docs
20+
#springdoc.swagger-ui.path=/swagger-ui.html
21+
#springdoc.swagger-ui.operationsSorter=method
22+
#springdoc.swagger-ui.disable-swagger-default-url=true
2323
springdoc.api-docs.enabled=true
24+
springdoc.swagger-ui.enabled=true
25+
springdoc.api-docs.path=/v3/api-docs
26+
springdoc.swagger-ui.use-root-path=false

0 commit comments

Comments
 (0)