Updated openapi config and app properties
This commit is contained in:
parent
58087efdc1
commit
4561e68c28
@ -1,12 +1,13 @@
|
||||
package com.cubetiqs.web.config
|
||||
|
||||
import com.cubetiqs.web.property.AppProperties
|
||||
import io.swagger.v3.oas.annotations.enums.SecuritySchemeType
|
||||
import io.swagger.v3.oas.annotations.security.SecurityScheme
|
||||
import io.swagger.v3.oas.models.ExternalDocumentation
|
||||
import io.swagger.v3.oas.models.OpenAPI
|
||||
import io.swagger.v3.oas.models.info.Info
|
||||
import io.swagger.v3.oas.models.info.License
|
||||
import org.springdoc.core.GroupedOpenApi
|
||||
import org.springframework.beans.factory.annotation.Autowired
|
||||
import org.springframework.context.annotation.Bean
|
||||
import org.springframework.context.annotation.Configuration
|
||||
|
||||
@ -16,9 +17,10 @@ import org.springframework.context.annotation.Configuration
|
||||
type = SecuritySchemeType.HTTP,
|
||||
scheme = "bearer",
|
||||
bearerFormat = "JWT",
|
||||
|
||||
)
|
||||
class OpenApiDocConfig {
|
||||
class OpenApiDocConfig @Autowired constructor(
|
||||
val appProperties: AppProperties,
|
||||
) {
|
||||
companion object {
|
||||
private val ADMIN_API_PATH get() = "/admin/**"
|
||||
private val DEFAULT_API_PATH get() = "/**"
|
||||
@ -46,15 +48,10 @@ class OpenApiDocConfig {
|
||||
fun cubetiqOpenAPI(): OpenAPI {
|
||||
return OpenAPI()
|
||||
.info(
|
||||
Info().title("CUBETIQ Web API")
|
||||
.description("CUBETIQ Spring Web API Application")
|
||||
.version("v0.0.1")
|
||||
.license(License().name("Apache 2.0").url("https://cubetiqs.com"))
|
||||
)
|
||||
.externalDocs(
|
||||
ExternalDocumentation()
|
||||
.description("CUBETIQ Web Wiki Documentation")
|
||||
.url("https://cubetiqs.com")
|
||||
Info().title(appProperties.appName)
|
||||
.description(appProperties.appDescription)
|
||||
.version(appProperties.appVersion)
|
||||
.license(License().name("Apache 2.0").url(appProperties.appLicenseUrl))
|
||||
)
|
||||
}
|
||||
}
|
@ -4,10 +4,16 @@ import com.cubetiqs.web.stereotype.FunctionComponent
|
||||
import org.springframework.beans.factory.annotation.Value
|
||||
|
||||
@FunctionComponent
|
||||
class AppProperties (
|
||||
@Value("\${cubetiq.app.name:CUBETIQ API Service}")
|
||||
class AppProperties(
|
||||
@Value("\${cubetiq.app.name:CUBETIQ Web API}")
|
||||
val appName: String,
|
||||
|
||||
@Value("\${cubetiq.app.description:CUBETIQ APIs Documentation}")
|
||||
@Value("\${cubetiq.app.description:CUBETIQ Web APIs Documentation}")
|
||||
val appDescription: String,
|
||||
|
||||
@Value("\${cubetiq.app.version:v0.0.1}")
|
||||
val appVersion: String,
|
||||
|
||||
@Value("\${cubetiq.app.license-url:https://cubetiqs.com}")
|
||||
val appLicenseUrl: String,
|
||||
)
|
@ -7,13 +7,14 @@ spring:
|
||||
cubetiq:
|
||||
app:
|
||||
data-dir: ${APP_DATA_DIR:${user.home}/${spring.application.name}}
|
||||
name: CUBETIQ API Service
|
||||
description: CUBETIQ API's Documentation
|
||||
name: CUBETIQ Web API
|
||||
description: CUBETIQ Spring Web API's Documentation
|
||||
|
||||
logging:
|
||||
file:
|
||||
path: ${LOGGING_FILE_PATH:${cubetiq.app.data-dir}/logs/}
|
||||
name: ${logging.file.path}/app.log
|
||||
|
||||
springdoc:
|
||||
api-docs:
|
||||
enabled: true
|
||||
|
Loading…
Reference in New Issue
Block a user