Franco
04/12/2020, 4:24 AMAny.asJsObject()
functions but that doesn't seem to do the trick.
My use case is that I'm trying to use the Firestore JS library to save some data but it only receives JS objects as input when trying to save data and I'm using normal Kotlin classes to handle this same data in the we app logic.turansky
04/12/2020, 7:12 AMkotlinx-serialization
?Franco
04/12/2020, 8:39 AMturansky
04/12/2020, 8:41 AMkotlinx-serialization
include both serialization & deserializationturansky
04/12/2020, 8:41 AMturansky
04/12/2020, 8:42 AMDynamicJbjectParser
)Franco
04/12/2020, 8:52 AMFranco
04/12/2020, 8:53 AMturansky
04/12/2020, 9:03 AMFranco
04/12/2020, 9:12 AMType inference failed: Not enough information to infer parameter T in fun <T> parse(text: String): T Please specify it explicitly.
then I tried setting the value of T like this:
val jsObject = JSON.parse<JsObject>(jsonString)
and it failed with this error:
Uncaught SyntaxError: Unexpected token a in JSON at position 2
Did you try that code and it worked for you?turansky
04/12/2020, 9:26 AMFranco
04/12/2020, 9:43 AMdynamic
did the trick, thanks! 🙂