intValueOrNull

fun JsonElement.intValueOrNull(vararg keys: String): Int?

Navigates to the nested element at keys and returns its integer value, or null if not found. Extension function on JsonElement.