From f6fc47a8f9fbd773f7623c86c48ba1e5e035c71e Mon Sep 17 00:00:00 2001 From: Antonin Delpeuch Date: Thu, 4 Oct 2018 17:54:22 +0100 Subject: [PATCH] Fix serialization of StandardReconConfig with no type --- .../google/refine/model/recon/StandardReconConfig.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/main/src/com/google/refine/model/recon/StandardReconConfig.java b/main/src/com/google/refine/model/recon/StandardReconConfig.java index 068bd4b29..b6156d29a 100644 --- a/main/src/com/google/refine/model/recon/StandardReconConfig.java +++ b/main/src/com/google/refine/model/recon/StandardReconConfig.java @@ -53,6 +53,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.refine.expr.ExpressionUtils; @@ -203,9 +205,12 @@ public class StandardReconConfig extends ReconConfig { } @JsonProperty("type") + @JsonInclude(Include.NON_NULL) public ReconType getReconType() { - ReconType t = new ReconType(typeID, typeName); - return t; + if (typeID != null) { + return new ReconType(typeID, typeName); + } + return null; } @Override