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