Excluded empty fields, during marshalling of error-messages
authorKai Moritz <kai@juplo.de>
Mon, 9 Jul 2018 18:57:29 +0000 (20:57 +0200)
committerKai Moritz <kai@jupl.de>
Fri, 22 Nov 2019 06:29:43 +0000 (07:29 +0100)
src/main/java/de/juplo/facebook/errors/FacebookErrorMessage.java

index 495c665..f807bc7 100644 (file)
@@ -1,6 +1,9 @@
 package de.juplo.facebook.errors;
 
 
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_EMPTY;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.fasterxml.jackson.annotation.JsonPropertyOrder;
 import com.fasterxml.jackson.annotation.JsonRootName;
@@ -23,20 +26,31 @@ import com.fasterxml.jackson.annotation.JsonRootName;
   "error_user_msg",
   "fbtrace_id"
   })
+@JsonIgnoreProperties(ignoreUnknown = true)
 public class FacebookErrorMessage
 {
   @JsonProperty("message")
+  @JsonInclude(NON_EMPTY)
   String message;
   @JsonProperty("type")
+  @JsonInclude(NON_EMPTY)
   String type;
   @JsonProperty("code")
+  @JsonInclude(NON_EMPTY)
   Integer code;
   @JsonProperty("error_subcode")
+  @JsonInclude(NON_EMPTY)
   Integer subCode;
   @JsonProperty("error_user_title")
+  @JsonInclude(NON_EMPTY)
   String userTitle;
   @JsonProperty("error_user_msg")
+  @JsonInclude(NON_EMPTY)
   String userMessage;
   @JsonProperty("fbtrace_id")
+  @JsonInclude(NON_EMPTY)
   String traceId;
+  @JsonProperty("is_transient")
+  @JsonInclude(NON_EMPTY)
+  Boolean isTransient;
 }