pajatopmr
12/07/2020, 4:19 PM"fieldName":234
), a structure ("fieldName":{...}
) or an array ("fieldName":["string1","string2","string3"]
), what is the most logical/appropriate KSX feature for handling the serialization of that JSON element. JsonContentPolymorphicSerializer has proven to be very helpful for "regular" TypeScript <-> Kotlin interface mappings, i.e. interface constructs that appear nearly the same in both languages. It is when TypeScript can have one of primitive, object and/or array JSON elements that it gets much harder, at least as I understand KSX so far. My current thinking is that the most likely feature to use is the experimental one ("Under the hood") in the Json Transformations in the fifth chapter of the Kotlin Serialization Guide. If there is an easier approach, I'd love to hear about it.Nikky
12/07/2020, 7:15 PMJsonTransformingSerializer
is the best option you have, i would probably combine it with https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/serializers.md#custom-serializers-for-a-generic-typepajatopmr
12/09/2020, 12:26 PM