Fix serialization of StandardReconConfig with no type

This commit is contained in:
Antonin Delpeuch 2018-10-04 17:54:22 +01:00
parent fec28b99bc
commit f6fc47a8f9

View File

@ -53,6 +53,8 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import com.fasterxml.jackson.annotation.JsonIgnore; 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.fasterxml.jackson.annotation.JsonProperty;
import com.google.refine.expr.ExpressionUtils; import com.google.refine.expr.ExpressionUtils;
@ -203,9 +205,12 @@ public class StandardReconConfig extends ReconConfig {
} }
@JsonProperty("type") @JsonProperty("type")
@JsonInclude(Include.NON_NULL)
public ReconType getReconType() { public ReconType getReconType() {
ReconType t = new ReconType(typeID, typeName); if (typeID != null) {
return t; return new ReconType(typeID, typeName);
}
return null;
} }
@Override @Override