diff --git a/src/main/java/uk/ac/ebi/eva/evaseqcol/controller/seqcol/SeqColController.java b/src/main/java/uk/ac/ebi/eva/evaseqcol/controller/seqcol/SeqColController.java index 07b9412..4329501 100644 --- a/src/main/java/uk/ac/ebi/eva/evaseqcol/controller/seqcol/SeqColController.java +++ b/src/main/java/uk/ac/ebi/eva/evaseqcol/controller/seqcol/SeqColController.java @@ -53,7 +53,16 @@ public ResponseEntity getSeqColByDigestAndLevel( required = true) @PathVariable String digest, @Parameter(name = "level", description = "The desired output's level (1 or 2)", - example = "1") @RequestParam(required = false) String level) { + example = "1") @RequestParam(required = false) String level, + @Parameter(name = "metadata", + description = "A boolean value that indicates if we need the metadata of the given seqcol digest", + example = "true, 1, yes") + @RequestParam(required = false, defaultValue = "false") boolean metadata) { + if (metadata) { + return new ResponseEntity<>( + seqColService.getSeqColMetadataBySeqColDigest(digest), HttpStatus.OK + ); + } if (level == null) level = "none"; try { switch (level) { @@ -83,13 +92,6 @@ public ResponseEntity getSeqColByDigestAndLevel( return new ResponseEntity<>(HttpStatus.NOT_FOUND); } - @GetMapping(value = "/collection/{digest}/metadata") - public ResponseEntity getSeqColMetadataByDigest(@PathVariable String digest) { - return new ResponseEntity<>( - seqColService.getSeqColMetadataBySeqColDigest(digest), HttpStatus.OK - ); - } - @GetMapping("/service-info") public ResponseEntity getServiceInfo() { try {