Convert serialized Kotlin data class to JSON Object

So I was working on a project a few days ago and I had to display a list of items programmatically, an example would make things...