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

Section 3.7.8 should be clarified

From: Sergey Beryozkin <sberyozkin_at_talend.com>
Date: Wed, 29 Apr 2015 14:05:56 +0100

Hi Santiago, All,

Section 3.7.8 (determining the media types of responses) specifies how a
response media type is determined.

IMHO it is worth clarifying that this section is only effective if a
response *entity is not null*.

We have a test issue reported something like the following is done:

public Response getMediaType() {
     return Response.ok().type(someMediType).build();
}

and the client is checking Content-Type.

But it is wrong to return Content-Type if no entity is available, it is
misleading at the very least as far as HTTP is concerned. It may not
necessarily break a client but IMHO the JAX-RS related tests should not
enforce the runtimes sending Content-Type with an empty body

Do you agree ?

Thanks, Sergey