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

[jsr339-experts] Re: [jax-rs-spec users] Re: Link 'produces' and 'consumes' parameters

From: Santiago Pericas-Geertsen <Santiago.PericasGeertsen_at_oracle.com>
Date: Fri, 17 Aug 2012 09:40:29 -0400

On Aug 17, 2012, at 8:24 AM, Sergey Beryozkin wrote:

> On 17/08/12 11:41, Sergey Beryozkin wrote:
>> Hi All,
>>
>> Can you remind me please where can I look at the syntax of 'produces'
>> and 'consumes' parameters [1] ? Not seeing them at [2]
>>
>
> Well, I can see Link 'type' attribute which is supposed to serve as a hint and 'produces' parameter seems to be duplicating 'type' but also extending it, given that the 'type' is supposed to have a single value only.
>
> So, are we talking about JAX-RS extension parameters ? Do not see anything wrong with that per se, except that it's unlikely any of the non-JAX-RS consumers will be able to understand them, so JAX-RS servers would have to set 'produces' but also 'type' (listing one of the produces values) to get the chance of the interoperable Link consumption working.

 That's right. The idea was to provide additional meta-data for those clients that may take advantage of it. Link parameters are intended to be extensible for that purpose.

> The syntax is also important: would 'produces' & 'consumes' lists support media type parameters ? If yes how it will fir into the overall Link syntax.

 The original idea was to use a subset of the syntax in the RFC, namely space-separated lists for all multi-valued params (see Link.toString()). However, this could be an issue with media types with parameters:

audio/*; q=0.2

 Hmmm. We'll need to revisit this.

> I wonder if we should just limit the support of media types to the 'type' attribute and postpone the support for multiple produces/consumes types when we have some realistic cases

 Perhaps, but people that have extended JAX-RS with hyperlinks have found this additional meta-data to be useful.

-- Santiago

>
>> Thanks, Sergey
>>
>> [1]
>> http://jax-rs-spec.java.net/nonav/2.0-SNAPSHOT/apidocs/javax/ws/rs/core/Link.html
>>
>> [2] http://tools.ietf.org/html/rfc5988#section-5
>