users@jax-rs-spec.java.net

[jax-rs-spec users] [JAX-RS 2.0] Resource method selection: @Consumes qs MediaType parameters

From: Andrei Shakirin <ashakirin_at_talend.com>
Date: Wed, 10 Apr 2013 08:05:16 +0000

Hi,

I have a question regarding matching requests to resource methods.
Spec description in 3.7.2 takes into account two intersections:

a) T X CM: Content Type and @Consumes

b) A X PM: Accept and @Produces
Each member in intersections will have quartet (media type, q, qs, d) and resource method candidates are sorted based on intersection (a) as primary key and intersection (b) as secondary.

1) Question: is qs parameter relevant for @Consumes annotation at all?
For example, is it possible to have:



Content-Type: application/json

@Consumes({"application/json; qs=0.4", "application/xml; qs=0.8"}) m1() {}

@Consumes({"application/json; qs=0.8", "application/xml; qs=0.4"}) m2() {}



and should m2() be selected in this case?

2) Question: is q parameter value always "1" for Content Type and @Consumes intersection?

Is my interpretation of spec correct?

Cheers,
Andrei.