From bd1009b920c989bbcec4a395be08e5094c652728 Mon Sep 17 00:00:00 2001 From: Gabriel Ittner Date: Fri, 6 Oct 2023 12:52:45 +0200 Subject: [PATCH] serialize pattern --- .../com/freeletics/khonshu/deeplinks/plugin/Configuration.kt | 2 +- .../freeletics/khonshu/navigation/deeplinks/DeepLinkHandler.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deeplinks-plugin/src/main/kotlin/com/freeletics/khonshu/deeplinks/plugin/Configuration.kt b/deeplinks-plugin/src/main/kotlin/com/freeletics/khonshu/deeplinks/plugin/Configuration.kt index 05c73680f..c8596052e 100644 --- a/deeplinks-plugin/src/main/kotlin/com/freeletics/khonshu/deeplinks/plugin/Configuration.kt +++ b/deeplinks-plugin/src/main/kotlin/com/freeletics/khonshu/deeplinks/plugin/Configuration.kt @@ -53,6 +53,6 @@ internal object PatternSerializer : KSerializer { } override fun serialize(encoder: Encoder, value: Pattern) { - throw UnsupportedOperationException() + encoder.encodeString(value.value) } } diff --git a/navigation/src/commonMain/kotlin/com/freeletics/khonshu/navigation/deeplinks/DeepLinkHandler.kt b/navigation/src/commonMain/kotlin/com/freeletics/khonshu/navigation/deeplinks/DeepLinkHandler.kt index 6eabd1e01..8c8c984dc 100644 --- a/navigation/src/commonMain/kotlin/com/freeletics/khonshu/navigation/deeplinks/DeepLinkHandler.kt +++ b/navigation/src/commonMain/kotlin/com/freeletics/khonshu/navigation/deeplinks/DeepLinkHandler.kt @@ -61,7 +61,7 @@ public interface DeepLinkHandler { * segment. */ @JvmInline - public value class Pattern(internal val value: String) { + public value class Pattern(public val value: String) { init { check(!value.startsWith("/")) { "Pattern should not start with a / but is $value" } check(!value.contains("?")) { "Pattern should not contain any query parameters but is $value" }