Commit 76f89223 authored by Matija Obreza's avatar Matija Obreza
Browse files

Fix: Serialize accession details with JsonView.Protected


Signed-off-by: Matija Obreza's avatarMatija Obreza <matija.obreza@croptrust.org>
parent 49951e9f
...@@ -183,14 +183,14 @@ public class AccessionController { ...@@ -183,14 +183,14 @@ public class AccessionController {
} }
@RequestMapping(value = "/details/10.{doi1:[0-9]+}/{doi2:.+}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @RequestMapping(value = "/details/10.{doi1:[0-9]+}/{doi2:.+}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
@JsonView(JsonViews.Public.class) @JsonView(JsonViews.Protected.class)
public AccessionDetailsJson getAccessionDetailsByDoi(@PathVariable("doi1") String doi1, @PathVariable("doi2") String doi2) { public AccessionDetailsJson getAccessionDetailsByDoi(@PathVariable("doi1") String doi1, @PathVariable("doi2") String doi2) {
Accession accession = accessionService.getByDoi("10." + doi1 + "/" + doi2); Accession accession = accessionService.getByDoi("10." + doi1 + "/" + doi2);
return getAccessionDetails(accession); return getAccessionDetails(accession);
} }
@GetMapping(value = "/details/{UUID:\\w{8}\\-\\w{4}.+}", produces = MediaType.APPLICATION_JSON_VALUE) @GetMapping(value = "/details/{UUID:\\w{8}\\-\\w{4}.+}", produces = MediaType.APPLICATION_JSON_VALUE)
@JsonView(JsonViews.Public.class) @JsonView(JsonViews.Protected.class)
public AccessionDetailsJson getAccessionDetailsByUUID(@PathVariable("UUID") final UUID uuid) { public AccessionDetailsJson getAccessionDetailsByUUID(@PathVariable("UUID") final UUID uuid) {
Accession accession = accessionService.getByUuid(uuid); Accession accession = accessionService.getByUuid(uuid);
return getAccessionDetails(accession); return getAccessionDetails(accession);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment