Data Class Either Object or Array
问题 I have a Kotlin data class that has an arg that can either be an Object or Array. Is there a way to de-serialize a string into this class and not care if not an Array but somehow get it into an array of one? data class Game(var name:List<NameItem>) data class NameItem(var title: String, var id: Int) data can come back as both ways a single object or an array of objects( I have no control over the data as it is 3rd party data. jsonString = "{"game":{"name":{"title":"GameName","id":22}}}"