Skip to content

Commit

Permalink
#28 Remove dependency from config4k
Browse files Browse the repository at this point in the history
  • Loading branch information
ihostage committed Feb 28, 2020
1 parent 1db5ebd commit 8fa6aea
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
1 change: 0 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ plugins {
allprojects {
repositories {
mavenCentral()
jcenter()
}
}

Expand Down
1 change: 0 additions & 1 deletion buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ object Versions {
const val ktlint = "0.32.0"
const val `ktlint-plugin` = "8.0.0"
const val `kotlin-logging` = "1.6.10"
const val config4k = "0.4.1"
const val swagger = "2.0.7"
const val jacoco = "0.8.4"
const val junit5 = "5.3.2"
Expand Down
1 change: 0 additions & 1 deletion java/impl/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ dependencies {
implementation(project(":lagom-openapi-core"))
compileOnly("com.lightbend.lagom", "lagom-javadsl-server_$scalaBinaryVersion", lagomVersion)
implementation("io.github.microutils", "kotlin-logging", Versions.`kotlin-logging`)
implementation("io.github.config4k", "config4k", Versions.config4k)

testImplementation(evaluationDependsOn(":lagom-openapi-core").sourceSets.test.get().output)
testImplementation("org.junit.jupiter", "junit-jupiter-api", Versions.junit5)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import com.lightbend.lagom.javadsl.api.transport.NotFound
import com.lightbend.lagom.javadsl.api.transport.ResponseHeader.OK
import com.lightbend.lagom.javadsl.server.HeaderServiceCall
import com.typesafe.config.Config
import io.github.config4k.extract
import io.swagger.v3.core.util.Yaml
import io.swagger.v3.oas.annotations.OpenAPIDefinition
import mu.KLogging
Expand Down Expand Up @@ -42,9 +41,10 @@ abstract class AbstractOpenAPIService(config: Config? = null) : OpenAPIService {
private fun createSpecResponseFromResource(config: Config?): OpenAPISpec {
var spec: String? = null
var protocol: MessageProtocol? = null
val paths = when (val configPath = config?.extract<String?>(SPEC_CONFIG_PATH)) {
null -> listOf("json", "yaml", "yml").map { "${descriptor().name()}.$it" }
else -> listOf(configPath)
val paths = if (config != null && config.hasPath(SPEC_CONFIG_PATH)) {
listOf(config.getString(SPEC_CONFIG_PATH))
} else {
listOf("json", "yaml", "yml").map { "${descriptor().name()}.$it" }
}
for (filename in paths) {
try {
Expand Down

0 comments on commit 8fa6aea

Please sign in to comment.