org.octopusden.octopus.dms.configuration.OpenApiConfig.kt Maven / Gradle / Ivy
package org.octopusden.octopus.dms.configuration
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.security.SecurityRequirement
import io.swagger.v3.oas.models.security.SecurityScheme
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
@Configuration
class OpenApiConfig {
@Bean
fun openApi(): OpenAPI {
val securitySchemeName = "bearerAuth"
return OpenAPI().info(Info().title("Distribution Management System Service").description("DMS Service API"))
.addSecurityItem(SecurityRequirement().addList(securitySchemeName)).components(
Components().addSecuritySchemes(
securitySchemeName,
SecurityScheme().name(securitySchemeName).type(SecurityScheme.Type.HTTP).scheme("bearer")
.bearerFormat("JWT")
)
)
}
}