diff --git a/main/src/com/google/refine/model/recon/StandardReconConfig.java b/main/src/com/google/refine/model/recon/StandardReconConfig.java index da11a6ba5..34981f0a5 100644 --- a/main/src/com/google/refine/model/recon/StandardReconConfig.java +++ b/main/src/com/google/refine/model/recon/StandardReconConfig.java @@ -334,7 +334,7 @@ public class StandardReconConfig extends ReconConfig { public String name; @JsonProperty("id") public String id; - @JsonProperty("types") + @JsonProperty("type") public List types = Collections.emptyList(); @JsonProperty("score") public double score; diff --git a/main/tests/server/src/com/google/refine/tests/model/recon/StandardReconConfigTests.java b/main/tests/server/src/com/google/refine/tests/model/recon/StandardReconConfigTests.java index 0019d5929..53d3e5373 100644 --- a/main/tests/server/src/com/google/refine/tests/model/recon/StandardReconConfigTests.java +++ b/main/tests/server/src/com/google/refine/tests/model/recon/StandardReconConfigTests.java @@ -20,6 +20,7 @@ import com.google.refine.model.recon.ReconConfig; import com.google.refine.model.recon.ReconJob; import com.google.refine.model.recon.StandardReconConfig; import com.google.refine.model.recon.StandardReconConfig.ColumnDetail; +import com.google.refine.model.recon.StandardReconConfig.ReconResult; import com.google.refine.operations.OperationRegistry; import com.google.refine.operations.recon.ReconOperation; import com.google.refine.tests.RefineTest; @@ -172,4 +173,17 @@ public class StandardReconConfigTests extends RefineTest { ColumnDetail cd = ParsingUtilities.mapper.readValue(uiJson, ColumnDetail.class); TestUtils.isSerializedTo(cd, backendJson); } + + @Test + public void deserializeReconResult() throws JsonParseException, JsonMappingException, IOException { + String json = "{\"score\":100.0," + + "\"match\":false," + + "\"type\":[" + + " {\"id\":\"Q17366755\"," + + " \"name\":\"hamlet in Alberta\"}]," + + "\"id\":\"Q5136635\"," + + "\"name\":\"Cluny\"}"; + ReconResult rr = ParsingUtilities.mapper.readValue(json, ReconResult.class); + assertEquals(rr.types.get(0).name, "hamlet in Alberta"); + } }