summaryrefslogtreecommitdiffstats
path: root/controller-api
diff options
context:
space:
mode:
Diffstat (limited to 'controller-api')
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/vcmr/VCMRReport.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/vcmr/VCMRReport.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/vcmr/VCMRReport.java
index 33d10083b63..a3c0af95053 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/vcmr/VCMRReport.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/vcmr/VCMRReport.java
@@ -30,6 +30,7 @@ public class VCMRReport {
private static final ObjectMapper objectMapper = new ObjectMapper()
.registerModule(new JavaTimeModule());
+ @JsonProperty("upcoming")
private Set<VCMR> vcmrs;
public VCMRReport() {
@@ -73,9 +74,7 @@ public class VCMRReport {
if (serialized == null)
return new VCMRReport();
- var typeRef = new TypeReference<Set<VCMR>>() {};
- var vcmrs = uncheck(() -> objectMapper.readValue(objectMapper.treeAsTokens(serialized), typeRef));
- return new VCMRReport(vcmrs);
+ return uncheck(() -> objectMapper.treeToValue(serialized, VCMRReport.class));
}
/**
@@ -85,7 +84,7 @@ public class VCMRReport {
public Map<String, JsonNode> toNodeReports() {
Map<String, JsonNode> reports = new HashMap<>();
JsonNode jsonNode = vcmrs.isEmpty() ?
- null : uncheck(() -> objectMapper.valueToTree(vcmrs));
+ null : uncheck(() -> objectMapper.valueToTree(this));
reports.put(REPORT_ID, jsonNode);
return reports;
}