Recently as a noob App dev though... wow... are people just this incapable of answering Stack Overflow questions or what??
So if, like me, you were unable to parse JSON to an object in Kotlin and went down a rabbit hole for 3 hours, maybe this will help you:
val jsonObj = JSONObject("{\"valu\":\"77\"}") var myVar: String? = nullif (jsonObj.has("valu")) { myVar = jsonObj.get("valu") as String }