stringValueOrNull

fun JsonElement.stringValueOrNull(vararg keys: String): String?

Navigates to the nested element at keys and returns its string value, or null if it is missing, JSON null, or not a primitive. Extension function on JsonElement.