From c361f04cd58629e08edfb794917fa0d19314efa3 Mon Sep 17 00:00:00 2001 From: gkim Date: Tue, 12 Dec 2023 20:54:37 +0900 Subject: [PATCH] :wrench: chore: Add swagger settings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - path 설정 - title, description, version 설명 추가 Related: #5 --- .../vote/common/config/SwaggerConfig.java | 25 +++++++++++++++++++ src/main/resources/application.yml | 11 +++----- 2 files changed, 29 insertions(+), 7 deletions(-) create mode 100644 src/main/java/com/ceos/vote/common/config/SwaggerConfig.java diff --git a/src/main/java/com/ceos/vote/common/config/SwaggerConfig.java b/src/main/java/com/ceos/vote/common/config/SwaggerConfig.java new file mode 100644 index 0000000..37c1fa0 --- /dev/null +++ b/src/main/java/com/ceos/vote/common/config/SwaggerConfig.java @@ -0,0 +1,25 @@ +package com.ceos.vote.common.config; + +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.OpenAPI; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class SwaggerConfig { + + @Bean + public OpenAPI openAPI() { + return new OpenAPI() + .components(new Components()) + .info(apiInfo()); + } + + private Info apiInfo() { + return new Info() + .title("ceos-vote-api") + .description("CEOS 파트장∙팀 투표 서비스") + .version("1.0.0"); + } +} diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index b3dba39..771aec8 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -33,10 +33,7 @@ server: enabled: true force: true port: 8080 -# -#springdoc: -# version: v1.0.0 -# swagger-ui: -# path: /swagger-filmo.html -# tagsSorter: alpha -# operationsSorter: alpha + +springdoc: + swagger-ui: + path: /swagger-vote.html