users@jax-rs-spec.java.net

[jax-rs-spec users] [jsr339-experts] Re: HEADS-UP: Late change to resolve spec/javadoc inconsistencies around reading zero-length entities

From: Sergey Beryozkin <sberyozkin_at_talend.com>
Date: Mon, 25 Mar 2013 11:09:02 +0300

Hi
On 22/03/13 21:24, Marek Potociar wrote:
> Hello experts,
> please review the http://java.net/jira/browse/JAX_RS_SPEC-390 issue
> including the comments that contain the resolution description.
>
> This late change was unfortunately necessary to fix the inconsistency
> between spec text and Response javadoc. Also, the old spec text was
> neglecting the scenarios where message body readers are used on the
> client side to read the response entities and throwing
> BadRequestException would be inappropriate in such case.

This text, "MBR.readFrom documentation will be updated to mention that
if MBR is not able to produce an instance that would represent an empty
content, it is expected to throw NoContentException (an IOException
subclass) and not return null.",

Would it break the applications written to expect that the empty
non-XML/JAXB payloads are represented as null ? AFAIK, only JAXB
providers were expected to return 400 if they could not read the body.

If I do a an empty form payload, this is obviously valid too (example, a
relevant @FormParam parameter would return 'null').

Sergey



>
> Thank you,
> Marek