I am trying to convert kotlin object class using Gson() to JSON string but it gives back null where as object fields are actually holding the values. if it's a singleton object why can't I directly use to convert it in JSON string?
val gson = Gson()
val dummy= Dummy
val objDummy = gson.toJson(dummy)
object class:
object Dummy: Serializable{
var test2: String? = "test2"
var blank: String? = null
var test1: String? = "test1"
}