Skip to content

Commit

Permalink
refactor: SwaggerConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
char-yb committed Sep 20, 2024
1 parent e58db62 commit 78c9f41
Showing 1 changed file with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,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.info.License;
import io.swagger.v3.oas.models.security.SecurityRequirement;
import io.swagger.v3.oas.models.security.SecurityScheme;
import io.swagger.v3.oas.models.servers.Server;
Expand All @@ -20,6 +21,9 @@
@Configuration
@RequiredArgsConstructor
public class SwaggerConfig {

private static final String SERVER_NAME = "WalWal";
private static final String GITHUB_URL = "https://github.com/depromeet/WalWal-server";
private static final String PACKAGES_TO_SCAN = "com.depromeet.stonebed";
private static final String SWAGGER_API_TITLE = "WalWal 프로젝트 API 문서";
private static final String SWAGGER_API_DESCRIPTION = "WalWal 프로젝트 API 문서입니다.";
Expand All @@ -36,11 +40,19 @@ public OpenAPI openAPI() {
.servers(swaggerServers())
.addSecurityItem(securityRequirement())
.components(authSetting())
.info(
new Info()
.title(SWAGGER_API_TITLE)
.version(apiVersion)
.description(SWAGGER_API_DESCRIPTION));
.info(swaggerInfo());
}

private Info swaggerInfo() {
License license = new License();
license.setUrl(GITHUB_URL);
license.setName(SERVER_NAME);

return new Info()
.title(SWAGGER_API_TITLE)
.version("v" + apiVersion)
.description(SWAGGER_API_DESCRIPTION)
.license(license);
}

private String getServerUrl() {
Expand Down

0 comments on commit 78c9f41

Please sign in to comment.