You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zeppelin.apache.org by GitBox <gi...@apache.org> on 2022/07/13 10:41:17 UTC

[GitHub] [zeppelin] Reamer commented on a diff in pull request #4407: [ZEPPELIN-5769] Roles in API-Request

Reamer commented on code in PR #4407:
URL: https://github.com/apache/zeppelin/pull/4407#discussion_r919929896


##########
zeppelin-server/src/main/java/org/apache/zeppelin/rest/message/NewNoteRequest.java:
##########
@@ -16,30 +16,33 @@
  */
 package org.apache.zeppelin.rest.message;
 
-import com.google.gson.Gson;
-
 import java.util.List;
 
-import org.apache.zeppelin.common.JsonSerializable;
-
 /**
  *  NewNoteRequest rest api request message.
  */
-public class NewNoteRequest implements JsonSerializable {
-  private static final Gson GSON = new Gson();
+public class NewNoteRequest {
 
   //TODO(zjffdu) rename it to be notePath instead of name
-  private String name;
-  private String defaultInterpreterGroup;
-  private boolean addingEmptyParagraph = false;
-  private List<NewParagraphRequest> paragraphs;
-  private String revisionId;
+  private final String name;
+  private final String defaultInterpreterGroup;
+  private final Boolean addingEmptyParagraph;

Review Comment:
   If the parameter is missing in the request and GSON deserializes a primitive data type, then the value cannot be null. Here it is a boolean, the default here is probably false.
   Unfortunately I did not find any GSON documentation of the default values of the primitive datatypes. So I decided to use the class Boolean to keep the default value with the null check.
   If you have a better idea, I would be very grateful. It should be clear what the default value is.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org