From: Kai Moritz Date: Mon, 9 Jul 2018 18:57:29 +0000 (+0200) Subject: Excluded empty fields, during marshalling of error-messages X-Git-Tag: wip-webclient~60 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=c2be258f2b9cbf81e42eb9cbc273d5eb216c80cd;p=facebook-errors Excluded empty fields, during marshalling of error-messages --- diff --git a/src/main/java/de/juplo/facebook/errors/FacebookErrorMessage.java b/src/main/java/de/juplo/facebook/errors/FacebookErrorMessage.java index 495c665..f807bc7 100644 --- a/src/main/java/de/juplo/facebook/errors/FacebookErrorMessage.java +++ b/src/main/java/de/juplo/facebook/errors/FacebookErrorMessage.java @@ -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; }