Skip to content

Commit

Permalink
[CHORE] Fix duplicate type fields (no one told me)
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Sikina committed Nov 20, 2024
1 parent 09f9c24 commit f00ad26
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public CategoricalConcept(String conceptPath, String dataset) {
}


@JsonProperty("type")
@Override
public ConceptType type() {
return ConceptType.Categorical;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public ContinuousConcept(
this(conceptPath, name, display, dataset, description, allowFiltering, min, max, studyAcronym, meta, null);
}

@JsonProperty("type")
@Override
public ConceptType type() {
return ConceptType.Continuous;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ void shouldIncludeTypeInList() throws JsonProcessingException {

String actual = new ObjectMapper().writeValueAsString(concepts);
String expected =
"[{\"conceptPath\":\"/foo//baz\",\"name\":\"baz\",\"display\":\"Baz\",\"dataset\":\"study_a\",\"description\":null,\"allowFiltering\":true,\"min\":0.0,\"max\":1.0,\"studyAcronym\":\"\",\"meta\":{},\"children\":null,\"table\":null,\"study\":null,\"type\":\"Continuous\"},{\"conceptPath\":\"/foo//bar\",\"name\":\"bar\",\"display\":\"Bar\",\"dataset\":\"study_a\",\"description\":null,\"values\":[\"a\",\"b\"],\"allowFiltering\":true,\"studyAcronym\":\"\",\"children\":null,\"meta\":{},\"table\":null,\"study\":null,\"type\":\"Categorical\"}]";

"[{\"conceptPath\":\"/foo//baz\",\"name\":\"baz\",\"display\":\"Baz\",\"dataset\":\"study_a\",\"description\":null,\"allowFiltering\":true,\"min\":0.0,\"max\":1.0,\"studyAcronym\":\"\",\"meta\":{},\"children\":null,\"table\":null,\"study\":null},{\"conceptPath\":\"/foo//bar\",\"name\":\"bar\",\"display\":\"Bar\",\"dataset\":\"study_a\",\"description\":null,\"values\":[\"a\",\"b\"],\"allowFiltering\":true,\"studyAcronym\":\"\",\"children\":null,\"meta\":{},\"table\":null,\"study\":null}]";
Assertions.assertEquals(expected, actual);
}
}

0 comments on commit f00ad26

Please sign in to comment.