diff --git a/build.gradle.kts b/build.gradle.kts index 4b53335..ccbdad5 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -10,8 +10,8 @@ import org.gradle.api.tasks.testing.logging.TestLogEvent plugins { // Apply the org.jetbrains.kotlin.jvm Plugin to add support for Kotlin. - kotlin("jvm") version "1.9.20" - kotlin("plugin.serialization") version "1.9.20" + kotlin("jvm") version "1.8.0" + kotlin("plugin.serialization") version "1.8.0" // Apply the java-library plugin for API and implementation separation. `java-library` @@ -61,7 +61,7 @@ dependencies { // This dependency is used internally, and not exposed to consumers on their own compile classpath. implementation("net.swiftzer.semver:semver:1.3.0") implementation("com.goncalossilva:murmurhash:0.4.0") - implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0") + implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.0") implementation("com.squareup.okhttp3:okhttp:4.11.0") implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3") } diff --git a/src/main/kotlin/com/featurevisor/sdk/Instance+Fetch.kt b/src/main/kotlin/com/featurevisor/sdk/Instance+Fetch.kt index 2b5e6a0..025fd2c 100644 --- a/src/main/kotlin/com/featurevisor/sdk/Instance+Fetch.kt +++ b/src/main/kotlin/com/featurevisor/sdk/Instance+Fetch.kt @@ -1,6 +1,7 @@ package com.featurevisor.sdk import com.featurevisor.types.DatafileContent +import kotlinx.serialization.decodeFromString import java.io.IOException import okhttp3.* import kotlinx.serialization.json.Json diff --git a/src/main/kotlin/com/featurevisor/sdk/Instance+Variable.kt b/src/main/kotlin/com/featurevisor/sdk/Instance+Variable.kt index 133eb49..925f20d 100644 --- a/src/main/kotlin/com/featurevisor/sdk/Instance+Variable.kt +++ b/src/main/kotlin/com/featurevisor/sdk/Instance+Variable.kt @@ -11,6 +11,7 @@ import com.featurevisor.types.VariableValue.IntValue import com.featurevisor.types.VariableValue.JsonValue import com.featurevisor.types.VariableValue.ObjectValue import com.featurevisor.types.VariableValue.StringValue +import kotlinx.serialization.decodeFromString import kotlinx.serialization.json.Json import kotlinx.serialization.json.decodeFromJsonElement import kotlinx.serialization.json.encodeToJsonElement diff --git a/src/main/kotlin/com/featurevisor/sdk/Instance.kt b/src/main/kotlin/com/featurevisor/sdk/Instance.kt index 1977b7c..3a7fb14 100644 --- a/src/main/kotlin/com/featurevisor/sdk/Instance.kt +++ b/src/main/kotlin/com/featurevisor/sdk/Instance.kt @@ -17,6 +17,7 @@ import com.featurevisor.types.EventName.UPDATE import com.featurevisor.types.Feature import com.featurevisor.types.StickyFeatures import kotlinx.coroutines.Job +import kotlinx.serialization.decodeFromString import kotlinx.serialization.json.Json typealias ConfigureBucketKey = (Feature, Context, BucketKey) -> BucketKey diff --git a/src/main/kotlin/com/featurevisor/sdk/serializers/Serializers.kt b/src/main/kotlin/com/featurevisor/sdk/serializers/Serializers.kt index 55c9726..04736d3 100644 --- a/src/main/kotlin/com/featurevisor/sdk/serializers/Serializers.kt +++ b/src/main/kotlin/com/featurevisor/sdk/serializers/Serializers.kt @@ -14,6 +14,7 @@ import kotlinx.serialization.InternalSerializationApi import kotlinx.serialization.KSerializer import kotlinx.serialization.SerializationException import kotlinx.serialization.Serializer +import kotlinx.serialization.decodeFromString import kotlinx.serialization.descriptors.PolymorphicKind import kotlinx.serialization.descriptors.SerialDescriptor import kotlinx.serialization.descriptors.buildSerialDescriptor