default JsonObject asJsonObject() throws JsonMappingException {
        return asJsonObjectOptional()
                .orElseThrow(() -> new JsonMappingException(null, String.format("Expected JSON object, received %s", node())));
    }
If this is a JSON object, return an instance of JsonObject. Otherwise, throw a JsonMappingException.
server-common/src/main/java/org/apache/kafka/server/util/json/JsonValue.java