summaryrefslogtreecommitdiffstats
path: root/controller-api
diff options
context:
space:
mode:
authorjonmv <venstad@gmail.com>2022-07-04 14:12:25 +0200
committerjonmv <venstad@gmail.com>2022-07-04 14:12:25 +0200
commit9390d6a2af485b002c7f03aa802f1f6721fd7aae (patch)
tree7cefa5dc138f098dc06fccf0e53b25269b089f10 /controller-api
parentb95b3bdd37693e755341b2ec02077739a9a10962 (diff)
Verify JSON when passing test report through controller
Diffstat (limited to 'controller-api')
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/TestReport.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/TestReport.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/TestReport.java
index 92063e1afee..789a909b780 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/TestReport.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/TestReport.java
@@ -1,10 +1,15 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.controller.api.integration.deployment;
+import com.yahoo.slime.SlimeUtils;
+
+import java.nio.charset.StandardCharsets;
+
/**
* @author mortent
*/
public class TestReport {
+
private final String report;
private TestReport(String report) {
@@ -16,6 +21,8 @@ public class TestReport {
}
public static TestReport fromJson(String report) {
+ SlimeUtils.jsonToSlimeOrThrow(report.getBytes(StandardCharsets.UTF_8)); // Verify structure.
return new TestReport(report);
}
+
}