Skip to content

Commit

Permalink
Add release note entry for #2467
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Sep 20, 2019
1 parent 839cc64 commit 09fd5a6
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions release-notes/CREDITS-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -963,3 +963,8 @@ David Connelly (dconnelly@github)
Wahey (KevynBct@github)
* Reported #2466: Didn't find class "java.nio.file.Path" below Android api 26
(2.10.0)
Martín Coll (colltoaction@github)
* Contributed #2467: Accept `JsonTypeInfo.As.WRAPPER_ARRAY` with no second argument to
deserialize as "null value"
(2.10.0)
3 changes: 3 additions & 0 deletions release-notes/VERSION-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ Project: jackson-databind

#2466: Didn't find class "java.nio.file.Path" below Android api 26
(reported by KevynBct@github)
#2467: Accept `JsonTypeInfo.As.WRAPPER_ARRAY` with no second argument to
deserialize as "null value"
(contributed by Martin C)
2.10.0.pr3 (17-Sep-2019)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ protected Object _deserialize(JsonParser p, DeserializationContext ctxt) throws
p = JsonParserSequence.createFlattened(false, tb.asParser(p), p);
p.nextToken();
}
// [databind#2467] (2.10): Allow missing value to be taken as "just use null value"
if (hadStartArray && p.currentToken() == JsonToken.END_ARRAY) {
return deser.getNullValue(ctxt);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public Cat(@JsonProperty("furColor") String c) {
public void setName(String n) { name = n; }
}

// for [JACKSON-319] -- allow "empty" beans
// Allow "empty" beans
@JsonTypeName("fishy")
static class Fish extends Animal
{
Expand All @@ -68,6 +68,7 @@ public Fish()
}
}

// [databind#2467]: Allow missing "content" for as-array deserialization
@JsonDeserialize(using = NullAnimalDeserializer.class)
static class NullAnimal extends Animal
{
Expand Down Expand Up @@ -264,6 +265,7 @@ public void testIssue506WithNumber() throws Exception
assertEquals(input.number, output.number);
}

// [databind#2467]: Allow missing "content" for as-array deserialization
public void testTypeAsArrayWithNullableType() throws Exception
{
ObjectMapper m = new ObjectMapper();
Expand All @@ -273,6 +275,7 @@ public void testTypeAsArrayWithNullableType() throws Exception
assertNull(a);
}

// [databind#2467]
public void testTypeAsArrayWithCustomDeserializer() throws Exception
{
ObjectMapper m = new ObjectMapper();
Expand Down

0 comments on commit 09fd5a6

Please sign in to comment.