Someone answered that question on SO and said I sh...
# javascript
v
Someone answered that question on SO and said I should consume the API as
dynamic
and the use dynamic-to-kotlin converter in
kotlinx.serialization
I would have liked a way to maintain type safety for this operation. Not a fan of using
dynamic
. Hopefully we will get there sometime soon!
g
This is answer from one of kotlinx.serilization (#serialization) authors and Kotlin team member But in your case it’s already not safe to use, it’s just a string evaluated and converted to json, so solution with dynamic is just fine and it’s type safe, you just request dynamic data and map it to Kotlin data class, in case of some error kotlinx.serialization will throw exception
👍 1