portfolio/src/main/java/com/google/sps/servlets/DataServlet.java
/**
    * Converts a CommentResponse instance into a JSON string using the Gson library. Note: We first added
    * the Gson library dependency to pom.xml.
    */
Converts a CommentResponse instance into a JSON string using the Gson library. Note: We first added
the Gson library dependency to pom.xml.
Converts a CommentResponse instance into a JSON string using the Gson library . Note : We first added the Gson library dependency to pom . xml .
private String convertToJsonUsingGson(CommentResponse responseData) {
        Gson gson = new Gson();
        String json = gson.toJson(responseData);
        return json;
    }
private String convertToJsonUsingGson ( CommentResponse responseData ) { Gson gson = new Gson ( ) ; String json = gson . toJson ( responseData ) ; return json ; }
Converts a CommentResponse instance into a JSON string using the Gson library.
Converts a CommentResponse instance into a JSON string using the Gson library .