diff --git a/src/main/java/io/openliberty/sample/application/CrewService.java b/src/main/java/io/openliberty/sample/application/CrewService.java index 9259843..52dbb48 100755 --- a/src/main/java/io/openliberty/sample/application/CrewService.java +++ b/src/main/java/io/openliberty/sample/application/CrewService.java @@ -64,6 +64,7 @@ public void remove(@PathParam("id") int id) { } @GET + @Produces(MediaType.APPLICATION_JSON) public String retrieve() { Iterable crewMembersIterable = crewMembers.findAll()::iterator; @@ -73,6 +74,7 @@ public String retrieve() { @GET @Path("/rank/{rank}") + @Produces(MediaType.APPLICATION_JSON) public String retrieveByRank(@PathParam("rank") String rank) { List crewMembersList = crewMembers.findByRank(Rank.fromString(rank)); @@ -82,6 +84,7 @@ public String retrieveByRank(@PathParam("rank") String rank) { @GET @Path("/rank/{rank}/page/{pageNum}") + @Produces(MediaType.APPLICATION_JSON) public String retrieveByRank(@PathParam("rank") String rank, @PathParam("pageNum") long pageNum) { @@ -89,9 +92,9 @@ public String retrieveByRank(@PathParam("rank") String rank, .page(pageNum) .sortBy(Sort.asc("name"), Sort.asc("id")); - Page crewMembersPage = crewMembers.findByRank(Rank.fromString(rank), pageRequest); + Page page = crewMembers.findByRank(Rank.fromString(rank), pageRequest); - return crewMembersToJsonArray(crewMembersPage); + return crewMembersToJsonArray(page); } @DELETE