Skip to content

Commit

Permalink
openapi 버전 명시 (#31)
Browse files Browse the repository at this point in the history
* openapi 버전을 명시한다

* fix: merge

* fix: Swagger config를 수정한다
  • Loading branch information
devxb authored Feb 8, 2025
1 parent ad3f4ef commit c682b99
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ h2Version=1.4.200

### Snowflake ###
snowflakeVersion=5.2.5

### SpringDoc ###
springDocVersion=2.3.0
4 changes: 2 additions & 2 deletions gradle/spring.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ dependencies {
implementation "org.springframework.boot:spring-boot-starter-web"
implementation "org.springframework.boot:spring-boot-starter-webflux"
implementation "org.springframework.boot:spring-boot-starter-data-jpa"
implementation 'org.springframework.retry:spring-retry'
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.2.0'
implementation "org.springframework.retry:spring-retry"
implementation "org.springdoc:springdoc-openapi-starter-webmvc-api:${springDocVersion}"

testImplementation "org.springframework.boot:spring-boot-starter-test"
}
19 changes: 15 additions & 4 deletions src/main/kotlin/me/misik/api/infra/SwaggerConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package me.misik.api.infra

import io.swagger.v3.oas.models.OpenAPI
import io.swagger.v3.oas.models.info.Info
import io.swagger.v3.oas.models.servers.Server
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration

Expand All @@ -10,10 +11,20 @@ class SwaggerConfig {

@Bean
fun customOpenAPI(): OpenAPI {
val info = Info()
.title("Misik API")
.version("1.0")
.description("Misik API Description")

val server = Server()
server.url = SWAGGER_URL

return OpenAPI()
.info(
Info().title("Misik API")
.version("1.0")
.description("Misik API Description"))
.info(info)
.servers(listOf(server))
}

private companion object {
private const val SWAGGER_URL = "misik-api"
}
}

0 comments on commit c682b99

Please sign in to comment.