jsr339-experts@jax-rs-spec.java.net

[jsr339-experts] Re: [jax-rs-spec users] Re: There could be more than one Link header for a given rel

From: Markus KARG <markus_at_headcrashing.eu>
Date: Tue, 23 Oct 2012 19:35:21 +0200

> On Oct 22, 2012, at 12:53 PM, Markus KARG wrote:
>
> > As the RFC allows it, we have to support it. There is no need to add
> > more methods if we *replace* getLink by getLinks.
>
> -1
>
> If we do that, we'd be designing the API for the exception not the
> rule. In the majority of cases, you'd have a collection with a single
> element.
>
> -- Santiago

What if you must write a JAX-RS client for an existing service that actually
is sending multiple same-name Links?

What if you must re-write a service using JAX-RS that already had such an
API and you must not break it for beakwards compatibility?

We cannot say "sorry folks, Santiago thought nobody will need it, so do not
use JAX-RS for it", as long as the RFC allows it.

Also, I do not see any problem to simply write "getLinks()[0]" or
"getLinks(0)" or "getLinks().next()" etc.