Try again to make predicatbly sorted content map

This commit is contained in:
2024-04-07 17:24:57 -05:00
parent 4d65fe8014
commit 5b6260dd1e

View File

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