Skip to content

Commit 12df7c8

Browse files
committed
REST API option to add report data in CDATA blocks or not.
1 parent 74dfe13 commit 12df7c8

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

jsonvalidator-service/src/main/java/eu/europa/ec/itb/json/rest/RestValidationController.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ public ResponseEntity<StreamingResponseBody> validate(
8585
if (MediaType.APPLICATION_JSON.equals(reportType)) {
8686
writeReportAsJson(outputStream, report, domainConfig);
8787
} else {
88-
var wrapInputInCDATA = Objects.requireNonNullElse(in.getWrapReportDataInCDATA(), true);
89-
fileManager.saveReport(report, outputStream, domainConfig, wrapInputInCDATA);
88+
var wrapReportDataInCDATA = Objects.requireNonNullElse(in.getWrapReportDataInCDATA(), false);
89+
fileManager.saveReport(report, outputStream, domainConfig, wrapReportDataInCDATA);
9090
}
9191
});
9292
}
@@ -155,8 +155,8 @@ public Output[] validateMultiple(
155155
Output output = new Output();
156156
var report = executeValidationProcess(input, domainConfig);
157157
try (var bos = new ByteArrayOutputStream()) {
158-
var wrapInputInCDATA = Objects.requireNonNullElse(input.getWrapReportDataInCDATA(), true);
159-
fileManager.saveReport(report, bos, domainConfig, wrapInputInCDATA);
158+
var wrapReportDataInCDATA = Objects.requireNonNullElse(input.getWrapReportDataInCDATA(), false);
159+
fileManager.saveReport(report, bos, domainConfig, wrapReportDataInCDATA);
160160
output.setReport(Base64.getEncoder().encodeToString(bos.toByteArray()));
161161
outputs.add(output);
162162
} catch (IOException e) {

jsonvalidator-service/src/main/java/eu/europa/ec/itb/json/rest/model/Input.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public class Input {
2929
private Boolean locationAsPointer;
3030
@Schema(description = "Whether to include the validated input in the resulting report's context section.", defaultValue = "false")
3131
private Boolean addInputToReport;
32-
@Schema(description = "Whether to wrap the input (see addInputToReport) in a CDATA block if producing an XML report. False results in adding the input via XML escaping.", defaultValue = "true")
32+
@Schema(description = "Whether to wrap the input (see addInputToReport) in a CDATA block if producing an XML report. False results in adding the input via XML escaping.", defaultValue = "false")
3333
private Boolean wrapReportDataInCDATA;
3434
@Schema(description = "Locale (language code) to use for reporting of results. If the provided locale is not supported by the validator the default locale will be used instead (e.g. 'fr', 'fr_FR').")
3535
private String locale;

0 commit comments

Comments
 (0)