Skip to content

Commit

Permalink
add header to api/variant-recommendation/
Browse files Browse the repository at this point in the history
  • Loading branch information
gebbing12 committed Sep 5, 2024
1 parent 1610670 commit 8983836
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import org.json.JSONArray;
Expand Down Expand Up @@ -36,7 +35,7 @@ public class VariantRecommendController {
private S3Service s3Service;

@GetMapping("/variant-recommendation/{filename}")
public ResponseEntity<String> requestData(@PathVariable String filename) throws IOException {
public ResponseEntity<List<Object>> requestData(@PathVariable String filename) throws IOException {
Optional<ResponseInputStream<GetObjectResponse>> s3object = s3Service.getObject(Constants.ONCOKB_S3_BUCKET, filename);
if (s3object.isPresent()) {
BufferedReader reader = new BufferedReader(new InputStreamReader(s3object.orElseThrow(), StandardCharsets.UTF_8));
Expand All @@ -55,7 +54,7 @@ public ResponseEntity<String> requestData(@PathVariable String filename) throws
}
jsonArray.put(jsonObject);
}
return ResponseEntity.ok(jsonArray.toString());
return ResponseEntity.ok(jsonArray.toList());
} else {
throw new ResourceNotFoundException("File not Found", ENTITY_NAME, "nofile");
}
Expand Down

0 comments on commit 8983836

Please sign in to comment.