Merged feature/CE-881-create-basic-saved-reports into integration/sprint-40

This commit is contained in:
2024-04-07 17:25:12 -05:00

View File

@ -103,10 +103,8 @@ public class RenderSavedReportProcessApiProcessOutput implements ApiProcessOutpu
@Override @Override
public Map<Integer, Response> getSpecResponses(String apiName) public Map<Integer, Response> getSpecResponses(String apiName)
{ {
return Map.of(HttpStatus.Code.OK.getCode(), new Response() Map<String, Content> contentMap = new LinkedHashMap<>();
.withDescription("Report contents in the requested format.") contentMap.put(ReportFormat.JSON.getMimeType(), new Content()
.withContent(new LinkedHashMap<>(Map.of(
ReportFormat.JSON.getMimeType(), new Content()
.withSchema(new Schema() .withSchema(new Schema()
.withDescription("JSON Report contents") .withDescription("JSON Report contents")
.withExample(""" .withExample("""
@ -116,8 +114,9 @@ public class RenderSavedReportProcessApiProcessOutput implements ApiProcessOutpu
] ]
""") """)
.withType("string") .withType("string")
.withFormat("text")), .withFormat("text")));
ReportFormat.CSV.getMimeType(), new Content()
contentMap.put(ReportFormat.CSV.getMimeType(), new Content()
.withSchema(new Schema() .withSchema(new Schema()
.withDescription("CSV Report contents") .withDescription("CSV Report contents")
.withExample(""" .withExample("""
@ -126,13 +125,17 @@ public class RenderSavedReportProcessApiProcessOutput implements ApiProcessOutpu
2,"Jean-Luc" 2,"Jean-Luc"
""") """)
.withType("string") .withType("string")
.withFormat("text")), .withFormat("text")));
ReportFormat.XLSX.getMimeType(), new Content()
contentMap.put(ReportFormat.XLSX.getMimeType(), new Content()
.withSchema(new Schema() .withSchema(new Schema()
.withDescription("Excel Report contents") .withDescription("Excel Report contents")
.withType("string") .withType("string")
.withFormat("binary")) .withFormat("binary")));
))));
return Map.of(HttpStatus.Code.OK.getCode(), new Response()
.withDescription("Report contents in the requested format.")
.withContent(contentMap));
} }
} }