users@jax-rs-spec.java.net

[jax-rs-spec users] [jsr339-experts] Re: Rules for resolving relative Links

From: Sergey Beryozkin <sberyozkin_at_talend.com>
Date: Thu, 12 Sep 2013 12:10:55 +0100

https://java.net/jira/browse/JAX_RS_SPEC-428

Thanks, Sergey
On 11/09/13 18:37, Sergey Beryozkin wrote:
> 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
>
>