07/21/2022, 9:41 PM
Kotlin - What is the easiest way to create a generic data object to transform into JSON for API requests? It is very easy to create native generic objects that can be serialized into JSON in dynamically typed languages like Python, PHP, or JS. With Kotlin, it seems like I will need to define a serializable data class, at the very least, in order to be able to compose JSON for transmission. This is workable, but it breaks down pretty quickly when the data is complex or variable, and because of this is not very reusable. Is there a good approach (using Kotlin) that allows for similar behavior to...