FasterXML/jackson-jaxrs-json-provider — Issue #4: JasksonJsonProvider treats empty POST/PUT bodies as a parse exception rather than as a null body
Author: mattbishop
Created: 2012-02-17 00:43:18+00:00
State: open

According to the spec, if the body of a POST and PUT are empty then the MessageBodyReader should consider the object to be null. The only exception to this is for JAXB providers.

JacksonJsonProvider fails to follow this requirement and instead throws an EOFException on an empty body. This bug does not apply to JacksonJaxbJsonProvider.

See Enhancement C003 in http://jsr311.java.net/drafts/changelog.1.1.html
See also http://java.net/jira/browse/JSR311-55

It is important to distinguish between partial streams and truly empty bodies. In the case of incomplete streams, an EOF/ParseException should be thrown rather than providing a null.