Declarative Linking is a useful—not to say necessary—feature to implement a HATEOAS RESTful service, but it lacks support for injecting Link headers in responses where the entity is a List (a very common case for GET requests).
I guess it depends on the fact that the Response filter can't retrieve the List generic type at runtime, then why not use the linking annotation on the resource class and methods instead (or in addition) of using them on the entity? The the Response filter will know which links to inject in the response headers—still being able to expand parametrized URIs when the entity is not a List but a proper entity class instance.
Declarative Linking is a useful—not to say necessary—feature to implement a HATEOAS RESTful service, but it lacks support for injecting Link headers in responses where the entity is a List (a very common case for GET requests). I guess it depends on the fact that the Response filter can't retrieve the List generic type at runtime, then why not use the linking annotation on the resource class and methods instead (or in addition) of using them on the entity? The the Response filter will know which links to inject in the response headers—still being able to expand parametrized URIs when the entity is not a List but a proper entity class instance.
Affected Versions
[2.22]