From e7b50c6ba2102fc9a59a460172aa7a4d82ad08df Mon Sep 17 00:00:00 2001 From: Alex Saveau Date: Wed, 15 Jul 2020 17:08:38 +0000 Subject: Address review comments and fix integration tests --- core/src/main/kotlin/configuration.kt | 8 +++++--- core/src/main/kotlin/defaultConfiguration.kt | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'core/src/main/kotlin') diff --git a/core/src/main/kotlin/configuration.kt b/core/src/main/kotlin/configuration.kt index a82551a1..bdb493b8 100644 --- a/core/src/main/kotlin/configuration.kt +++ b/core/src/main/kotlin/configuration.kt @@ -5,6 +5,7 @@ package org.jetbrains.dokka import kotlinx.serialization.Serializable import kotlinx.serialization.UnstableDefault import kotlinx.serialization.json.Json +import kotlinx.serialization.json.JsonConfiguration import java.io.File import java.net.URL @@ -26,7 +27,7 @@ object DokkaDefaults { val analysisPlatform: Platform = Platform.DEFAULT const val suppress: Boolean = false - const val displayName = "JVM" + const val sourceSetDisplayName = "JVM" const val sourceSetName = "main" } @@ -62,8 +63,9 @@ data class DokkaSourceSetID( } @OptIn(UnstableDefault::class) -fun DokkaConfigurationImpl(json: String): DokkaConfigurationImpl { - return Json.parse(DokkaConfigurationImpl.serializer(), json) +fun DokkaConfigurationImpl(input: String): DokkaConfigurationImpl { + val json = Json(JsonConfiguration.Default.copy(ignoreUnknownKeys = true)) + return json.parse(DokkaConfigurationImpl.serializer(), input) } interface DokkaConfiguration { diff --git a/core/src/main/kotlin/defaultConfiguration.kt b/core/src/main/kotlin/defaultConfiguration.kt index fde0bd6a..4730bab4 100644 --- a/core/src/main/kotlin/defaultConfiguration.kt +++ b/core/src/main/kotlin/defaultConfiguration.kt @@ -20,7 +20,7 @@ data class DokkaConfigurationImpl( @Serializable data class DokkaSourceSetImpl( override val moduleDisplayName: String, - override val displayName: String = DokkaDefaults.displayName, + override val displayName: String = DokkaDefaults.sourceSetDisplayName, override val sourceSetID: DokkaSourceSetID, override val classpath: List = emptyList(), override val sourceRoots: List, -- cgit