isEmpty

fun JsonElement.isEmpty(): Boolean

Returns true if this JsonElement is empty: an object with no keys, an array with no elements, JSON null, or a primitive whose content is the empty string. A whitespace-only string is not empty.

Extension function on JsonElement.