aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/remote/RemoteAgent.kt14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/remote/RemoteAgent.kt b/src/main/kotlin/pl/treksoft/kvision/remote/RemoteAgent.kt
index 4c6ecf82..151f84a2 100644
--- a/src/main/kotlin/pl/treksoft/kvision/remote/RemoteAgent.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/remote/RemoteAgent.kt
@@ -337,11 +337,15 @@ open class RemoteAgent<out T>(val serviceManager: ServiceManager<T>) {
if (serializer != null) {
JSON.stringify(serializer, it)
} else {
- try {
- @Suppress("UNCHECKED_CAST")
- JSON.stringify((PAR::class as KClass<Any>).serializer(), it as Any)
- } catch (e: Throwable) {
- it.toString()
+ if (it is Enum<*>) {
+ "\"$it\""
+ } else {
+ try {
+ @Suppress("UNCHECKED_CAST")
+ JSON.stringify((PAR::class as KClass<Any>).serializer(), it as Any)
+ } catch (e: Throwable) {
+ it.toString()
+ }
}
}
}