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

[jsr339-experts] Re: Rules for resolving relative Links

From: Sergey Beryozkin <sberyozkin_at_talend.com>
Date: Wed, 11 Sep 2013 18:37:00 +0100

On 11/09/13 14:15, Sergey Beryozkin wrote:
> Hi Santiago, All,
>
> What are the rules of resolving Links with relative URIs in
> Response.getLinks() ?
>
> The documentation only mentions that the resolution has to take place.
>
> I'm asking because I'm seeing unexpected test failures.
>
> For example, request uri is
>
> http://localhost:8080/resource/get
>
> Link URI is: "resource/consumesjson"
>
> I expect that a resolved URI will produce:
>
> http://localhost:8080/resource/resource/consumesjson
>
> (this is correct per the regular URI resolution process)
>
> but the test expects that
>
> http://localhost:8080/resource/consumesjson
>
> will be produced.

This latter option makes more sense, but there has to be some guidance
on why this latter URI should be produced, even if a relative Link URI
does not start from a '/' character.

Sergey

>
> Before challenging it, I wonder if the expectation is that a relative
> URI will always be added to the request URI host & port only in
> Response.getLinks() ?
>
> Thanks, Sergey


-- 
Sergey Beryozkin
Talend Community Coders
http://coders.talend.com/
Blog: http://sberyozkin.blogspot.com