JacksonJsonProvider MessageBodyReader 'readFrom' returns null #49
Comments
|
(comment copied from the original bug) Looks like the old behavior was specified in one of the drafts of the specification (and this was reported in old issue 17). Does seem to have changed in the published spec. |
|
Maybe introducing a DeserializationFeature.FAIL_ON_EMPTY_SOURCE (default false) would be an option? |
|
+1 (subscribe) |
|
Hmmh. One nasty problem with So what would be suitable alternative? I assume JAX-RS 1.1 should have some suggestion here. |
|
One idea... maybe I can just dynamically locate the exception class if it's there. |
|
Yes sounds reasonable. M Sent from my iPhone 5s
|
|
Ok: Added |
(note: moved from https://github.com/FasterXML/jackson-jaxrs-json-provider/issues/27)
The readFrom() method in ProviderBase returns null when it encounters an empty stream. According to both the javadoc for MessageBodyReader, and JSR311, this is not allowed.
http://download.oracle.com/otndocs/jcp/jaxrs-1.1-mrel-eval-oth-JSpec/
In section 4.2.4:
And if creating an object representing the zero-length entity is impossible, the MessageBodyReader javadoc specifies that:
Offending code in question on line 750:
ObjectReader reader = endpoint.getReader();
JsonParser jp = _createParser(reader, entityStream);
The text was updated successfully, but these errors were encountered: