File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
src/test/java/com/fasterxml/jackson/databind/deser/filter Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,9 @@ Project: jackson-databind
21
21
#2001 : Deserialization issue with `@JsonIgnore` and `@JsonCreator` + `@JsonProperty`
22
22
for same property name
23
23
(reported, fix contributed by Jakub S)
24
+ #2015 : `@Jsonsetter with Nulls.SKIP` collides with
25
+ `DeserializationFeature.READ_UNKNOWN_ENUM_VALUES_AS_NULL` when parsing enum
26
+ (reported by ndori@github)
24
27
#2016 : Delegating JsonCreator disregards JsonDeserialize info
25
28
(reported by Carter K)
26
29
#2019 : Abstract Type mapping in 2.9 fails when multiple modules are registered
Original file line number Diff line number Diff line change @@ -36,6 +36,16 @@ public void setValue(String v) {
36
36
}
37
37
}
38
38
39
+ // for [databind#2015]
40
+ enum NUMS2015 {
41
+ ONE , TWO
42
+ }
43
+
44
+ public static class Pojo2015 {
45
+ @ JsonSetter (value = "number" , nulls = Nulls .SKIP )
46
+ NUMS2015 number = NUMS2015 .TWO ;
47
+ }
48
+
39
49
/*
40
50
/**********************************************************
41
51
/* Test methods, straight annotation
@@ -72,6 +82,15 @@ public void testSkipNullMethod() throws Exception
72
82
assertEquals ("a" , result ._nullsOk );
73
83
}
74
84
85
+ // for [databind#2015]
86
+ public void testEnumAsNullThenSkip () throws Exception
87
+ {
88
+ Pojo2015 p = MAPPER .readerFor (Pojo2015 .class )
89
+ .with (DeserializationFeature .READ_UNKNOWN_ENUM_VALUES_AS_NULL )
90
+ .readValue ("{\" number\" :\" THREE\" }" );
91
+ assertEquals (NUMS2015 .TWO , p .number );
92
+ }
93
+
75
94
/*
76
95
/**********************************************************
77
96
/* Test methods, defaulting
You can’t perform that action at this time.
0 commit comments