Hi, everyone I am trying to deserialize the api re...
# react
s
Hi, everyone I am trying to deserialize the api response in kotlin/js but so far I have figured out that to deserialize the response I have to create the response object( data class), I am only interested in 2 properties from the response object and for that I have to declare the complete object with all properties on my side, kotlin/js is not allowing me to deserialize it to dynamic type, any thoughts how to do it?
1
t
for that I have to declare the complete object with all properties
You can ignore unknown keys with custom
Json
:
Copy code
private val defaultJson: Json = Json {
    ignoreUnknownKeys = true
}

defaultJson.decodeFromString(...)
s
Thank you so much @turansky, it worked 🙂