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

[jsr339-experts] Re: [jax-rs-spec users] MediaType parameters and the method selection

From: Santiago Pericas-Geertsen <Santiago.PericasGeertsen_at_oracle.com>
Date: Wed, 2 Oct 2013 16:27:17 -0400

Hi Sergey,

 The matching algorithm in the spec only considers the interactions between q and qs in the manner we defined. It doesn't consider any other media type params as far as I recall.

-- Santiago

On Oct 2, 2013, at 6:36 AM, Sergey Beryozkin <sberyozkin_at_talend.com> wrote:

> Hi,
>
> Can custom media type parameters affect the method selection, example
>
> @Path("/")
> public class Resource {
>
> @POST
> @Consumes("application/json")
> public void m1(SomeData data) {}
> @POST
> @Consumes("application/json;a=b")
> public void m2(SomeData data) {}
>
> }
>
> Request has:
>
> Content-Type: application/json;a=b
>
> Method m2 seems like a better candidate than m1, but is there anything in the spec that would support the consistent selection of m2 ?
>
> Cheers, Sergey