You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On 2.8.7, I turn on DeserializationFeature.UNWRAP_SINGLE_VALUE_ARRAYS and DeserializationFeature.ACCEPT_EMPTY_ARRAY_AS_NULL_OBJECT. The JSON:
{"id":[]}
Cannot deserialize to an instance of the class:
public static class TestArrayBean{
private String id;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
}
(Can not deserialize instance of java.lang.String out of END_ARRAY token).
It works if there is a value.
I was hoping to get a non null bean with a null id member.
The text was updated successfully, but these errors were encountered:
JPMoresmau
changed the title
DeserializationFeature.ACCEPT_EMPTY_ARRAY_AS_NULL_OBJECT
DeserializationFeature.ACCEPT_EMPTY_ARRAY_AS_NULL_OBJECT not respected?
Mar 22, 2017
@JPMoresmau Yes may well be the same. You may want to close this one, unless you think they differ.
I would hope to address it, but looking at everything I've tagged with 2.9, a PR would certainly improve chances of this getting fixed for 2.9.0 (and if simple enough, backported in 2.8 too).
On 2.8.7, I turn on
DeserializationFeature.UNWRAP_SINGLE_VALUE_ARRAYS
andDeserializationFeature.ACCEPT_EMPTY_ARRAY_AS_NULL_OBJECT
. The JSON:Cannot deserialize to an instance of the class:
(Can not deserialize instance of java.lang.String out of END_ARRAY token).
It works if there is a value.
I was hoping to get a non null bean with a null id member.
The text was updated successfully, but these errors were encountered: