booleanValueOrNull

fun JsonElement.booleanValueOrNull(vararg keys: String): Boolean?

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