aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/pl/treksoft/kvision/remote
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision/remote')
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/remote/CallAgent.kt3
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/remote/JoobyRemoteAgent.kt2
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/remote/RemoteAgent.kt2
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/remote/SpringRemoteAgent.kt2
4 files changed, 9 insertions, 0 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/remote/CallAgent.kt b/src/main/kotlin/pl/treksoft/kvision/remote/CallAgent.kt
index a48a6b1f..4a086e2a 100644
--- a/src/main/kotlin/pl/treksoft/kvision/remote/CallAgent.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/remote/CallAgent.kt
@@ -21,6 +21,8 @@
*/
package pl.treksoft.kvision.remote
+import kotlinx.serialization.ImplicitReflectionSerializer
+import kotlinx.serialization.stringify
import pl.treksoft.jquery.JQueryAjaxSettings
import pl.treksoft.jquery.JQueryXHR
import pl.treksoft.jquery.jQuery
@@ -49,6 +51,7 @@ open class CallAgent {
* @param data data to be sent
* @return a promise of the result
*/
+ @UseExperimental(ImplicitReflectionSerializer::class)
@Suppress("UnsafeCastFromDynamic")
fun jsonRpcCall(
url: String,
diff --git a/src/main/kotlin/pl/treksoft/kvision/remote/JoobyRemoteAgent.kt b/src/main/kotlin/pl/treksoft/kvision/remote/JoobyRemoteAgent.kt
index b4cc6c21..30d2062d 100644
--- a/src/main/kotlin/pl/treksoft/kvision/remote/JoobyRemoteAgent.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/remote/JoobyRemoteAgent.kt
@@ -23,6 +23,7 @@ package pl.treksoft.kvision.remote
import kotlinx.coroutines.Deferred
import kotlinx.coroutines.asDeferred
+import kotlinx.serialization.ImplicitReflectionSerializer
import kotlinx.serialization.list
import kotlinx.serialization.serializer
import pl.treksoft.kvision.utils.JSON
@@ -34,6 +35,7 @@ import kotlin.js.JSON as NativeJSON
* Client side agent for JSON-RPC remote calls with Jooby.
*/
@Suppress("LargeClass", "TooManyFunctions")
+@UseExperimental(ImplicitReflectionSerializer::class)
open class JoobyRemoteAgent<T : Any>(val serviceManager: JoobyServiceManager<T>) : RemoteAgent {
val callAgent = CallAgent()
diff --git a/src/main/kotlin/pl/treksoft/kvision/remote/RemoteAgent.kt b/src/main/kotlin/pl/treksoft/kvision/remote/RemoteAgent.kt
index b1ee4fde..cbb2978a 100644
--- a/src/main/kotlin/pl/treksoft/kvision/remote/RemoteAgent.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/remote/RemoteAgent.kt
@@ -21,6 +21,7 @@
*/
package pl.treksoft.kvision.remote
+import kotlinx.serialization.ImplicitReflectionSerializer
import kotlinx.serialization.KSerializer
import kotlinx.serialization.internal.BooleanSerializer
import kotlinx.serialization.internal.ByteSerializer
@@ -52,6 +53,7 @@ interface RemoteAgent {
* @suppress
* Internal function
*/
+ @UseExperimental(ImplicitReflectionSerializer::class)
@Suppress("ComplexMethod", "TooGenericExceptionCaught", "NestedBlockDepth")
fun trySerialize(kClass: KClass<Any>, value: Any): String {
return if (value is List<*>) {
diff --git a/src/main/kotlin/pl/treksoft/kvision/remote/SpringRemoteAgent.kt b/src/main/kotlin/pl/treksoft/kvision/remote/SpringRemoteAgent.kt
index f1f3b473..f329d10e 100644
--- a/src/main/kotlin/pl/treksoft/kvision/remote/SpringRemoteAgent.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/remote/SpringRemoteAgent.kt
@@ -23,6 +23,7 @@ package pl.treksoft.kvision.remote
import kotlinx.coroutines.Deferred
import kotlinx.coroutines.asDeferred
+import kotlinx.serialization.ImplicitReflectionSerializer
import kotlinx.serialization.list
import kotlinx.serialization.serializer
import pl.treksoft.kvision.utils.JSON
@@ -34,6 +35,7 @@ import kotlin.js.JSON as NativeJSON
* Client side agent for JSON-RPC remote calls with Spring Boot.
*/
@Suppress("LargeClass", "TooManyFunctions")
+@UseExperimental(ImplicitReflectionSerializer::class)
open class SpringRemoteAgent<T : Any>(val serviceManager: SpringServiceManager<T>) : RemoteAgent {
val callAgent = CallAgent()