From 70b1872b7c4ad014e10527ca2e0cf98ea7d96581 Mon Sep 17 00:00:00 2001 From: d1snin Date: Sat, 2 Sep 2023 04:03:50 +0300 Subject: [PATCH] fix: mark `ClientWebSocketEvent` as serializable --- ktor-ws-events-client/build.gradle.kts | 8 ++++++++ .../dev/d1s/ktor/events/client/ClientWebSocketEvent.kt | 2 ++ 2 files changed, 10 insertions(+) diff --git a/ktor-ws-events-client/build.gradle.kts b/ktor-ws-events-client/build.gradle.kts index f02e59c..dee513d 100644 --- a/ktor-ws-events-client/build.gradle.kts +++ b/ktor-ws-events-client/build.gradle.kts @@ -14,6 +14,10 @@ * limitations under the License. */ +plugins { + kotlin("plugin.serialization") +} + apply { val publishingScript: String by project @@ -38,10 +42,14 @@ kotlin { dependencies { val ktorVersion: String by project + val kotlinxSerializationVersion: String by project + api(project(":ktor-ws-events-commons")) implementation("io.ktor:ktor-client-core:$ktorVersion") implementation("io.ktor:ktor-client-websockets:$ktorVersion") + + implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:$kotlinxSerializationVersion") } } } diff --git a/ktor-ws-events-client/src/commonMain/kotlin/dev/d1s/ktor/events/client/ClientWebSocketEvent.kt b/ktor-ws-events-client/src/commonMain/kotlin/dev/d1s/ktor/events/client/ClientWebSocketEvent.kt index d572b85..138572a 100644 --- a/ktor-ws-events-client/src/commonMain/kotlin/dev/d1s/ktor/events/client/ClientWebSocketEvent.kt +++ b/ktor-ws-events-client/src/commonMain/kotlin/dev/d1s/ktor/events/client/ClientWebSocketEvent.kt @@ -1,7 +1,9 @@ package dev.d1s.ktor.events.client import dev.d1s.ktor.events.commons.EventReference +import kotlinx.serialization.Serializable +@Serializable public data class ClientWebSocketEvent( val reference: EventReference, val data: T