diff --git a/release-notes/VERSION-2.x b/release-notes/VERSION-2.x index 29ceb9d470..1f56feeea7 100644 --- a/release-notes/VERSION-2.x +++ b/release-notes/VERSION-2.x @@ -21,6 +21,9 @@ Project: jackson-databind #2001: Deserialization issue with `@JsonIgnore` and `@JsonCreator` + `@JsonProperty` for same property name (reported, fix contributed by Jakub S) +#2015: `@Jsonsetter with Nulls.SKIP` collides with + `DeserializationFeature.READ_UNKNOWN_ENUM_VALUES_AS_NULL` when parsing enum + (reported by ndori@github) #2016: Delegating JsonCreator disregards JsonDeserialize info (reported by Carter K) #2019: Abstract Type mapping in 2.9 fails when multiple modules are registered diff --git a/src/test/java/com/fasterxml/jackson/databind/deser/filter/NullConversionsSkipTest.java b/src/test/java/com/fasterxml/jackson/databind/deser/filter/NullConversionsSkipTest.java index 7ff98ec8de..9fe93a340d 100644 --- a/src/test/java/com/fasterxml/jackson/databind/deser/filter/NullConversionsSkipTest.java +++ b/src/test/java/com/fasterxml/jackson/databind/deser/filter/NullConversionsSkipTest.java @@ -36,6 +36,16 @@ public void setValue(String v) { } } + // for [databind#2015] + enum NUMS2015 { + ONE, TWO + } + + public static class Pojo2015 { + @JsonSetter(value = "number", nulls = Nulls.SKIP) + NUMS2015 number = NUMS2015.TWO; + } + /* /********************************************************** /* Test methods, straight annotation @@ -72,6 +82,15 @@ public void testSkipNullMethod() throws Exception assertEquals("a", result._nullsOk); } + // for [databind#2015] + public void testEnumAsNullThenSkip() throws Exception + { + Pojo2015 p = MAPPER.readerFor(Pojo2015.class) + .with(DeserializationFeature.READ_UNKNOWN_ENUM_VALUES_AS_NULL) + .readValue("{\"number\":\"THREE\"}"); + assertEquals(NUMS2015.TWO, p.number); + } + /* /********************************************************** /* Test methods, defaulting