Skip to content
Snippets Groups Projects
Commit 5adb5a0e authored by Emmanuel Bruno's avatar Emmanuel Bruno
Browse files

produces links header only when not empty.

parent b86a63ea
No related branches found
No related tags found
No related merge requests found
......@@ -13,7 +13,6 @@ import lombok.extern.java.Log;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collector;
import java.util.stream.Collectors;
@Provider
......@@ -76,6 +75,7 @@ public class PaginationLinkFilter implements ContainerResponseFilter {
.build());
}
if (!linksList.isEmpty())
responseContext.getHeaders().add("Link", linksList.stream().map(l -> l.toString()).collect(Collectors.joining(",")));
//We add pagination metadata in the header
responseContext.getHeaders().add(JAXRS_SAMPLE_TOTAL_COUNT, entity.getElementTotal());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment