private static boolean isValidJson(String json) {
        // Use a JSON library or parser to validate the JSON format
        try {
            gson.fromJson(json, Object.class);
            return true;
        } catch (JsonSyntaxException e) {
            LOGGER.error("JSON validation failed with exception: {}", e.getMessage());
            return false;
        }
    }
Validates whether the given JSON string has a valid format by attempting to parse it.

@param json The JSON string to validate.
@return {@code true} if the JSON format is valid, {@code false} otherwise.
inlong-tubemq/tubemq-manager/src/main/java/org/apache/inlong/tubemq/manager/controller/topic/TopicWebController.java