File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
src/test/java/com/fasterxml/jackson/databind/deser/filter Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 3
3
import java .util .List ;
4
4
import java .util .Map ;
5
5
6
+ import com .fasterxml .jackson .annotation .JsonCreator ;
7
+ import com .fasterxml .jackson .annotation .JsonProperty ;
6
8
import com .fasterxml .jackson .annotation .JsonSetter ;
7
9
import com .fasterxml .jackson .annotation .Nulls ;
8
10
import com .fasterxml .jackson .core .type .TypeReference ;
@@ -60,6 +62,18 @@ public void testNullsToEmptyPojo() throws Exception
60
62
}
61
63
}
62
64
65
+ // [databind#2023] two-part coercion from "" to `null` to skip/empty/exception should work
66
+ public void testEmptyStringToNullToEmptyPojo () throws Exception
67
+ {
68
+ GeneralEmpty <Point > result = MAPPER .readerFor (new TypeReference <GeneralEmpty <Point >>() { })
69
+ .with (DeserializationFeature .ACCEPT_EMPTY_STRING_AS_NULL_OBJECT )
70
+ .readValue (aposToQuotes ("{'value':''}" ));
71
+ assertNotNull (result .value );
72
+ Point p = result .value ;
73
+ assertEquals (0 , p .x );
74
+ assertEquals (0 , p .y );
75
+ }
76
+
63
77
public void testNullsToEmptyCollection () throws Exception
64
78
{
65
79
GeneralEmpty <List <String >> result = MAPPER .readValue (aposToQuotes ("{'value':null}" ),
You can’t perform that action at this time.
0 commit comments