-
Bug
-
Resolution: Done
-
Major
-
1.0.2.GA
-
None
-
None
Service definition goes like this:
@GET
@Path(GET_PATH)
@Produces(
)
@Mapped(attributesAsElements=
)
PlaceDto findById(@PathParam("id") Long id,
@HeaderParam(PlacesRestUtil.COUNTRY_HEADER) String country,
@HeaderParam(PlacesRestUtil.USER_HEADER) String ncimId);
When executing request with Accept header:
text/html,application/xhtml+xml,application/xml,/;q=0.8
output is XML
and when with:
text/html,application/xhtml+xml,/;q=0.8,application/xml
output is JSON
Content type should be provided based on "relative degree of preference - q" not on position of the media type in Accept header string.
Most important is that according to RE documentation:
"Accept header or @Produces @Consumes can also specify weighted preferences that are used to match up requests with resource methods. This is best explained by RFC 2616 section 14.1"
... service specified as above should return JSON in both cases.