Skip to content

Commit 09fd5a6

Browse files
committed
Add release note entry for #2467
1 parent 839cc64 commit 09fd5a6

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed

release-notes/CREDITS-2.x

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -963,3 +963,8 @@ David Connelly (dconnelly@github)
963963
Wahey (KevynBct@github)
964964
* Reported #2466: Didn't find class "java.nio.file.Path" below Android api 26
965965
(2.10.0)
966+
967+
Martín Coll (colltoaction@github)
968+
* Contributed #2467: Accept `JsonTypeInfo.As.WRAPPER_ARRAY` with no second argument to
969+
deserialize as "null value"
970+
(2.10.0)

release-notes/VERSION-2.x

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ Project: jackson-databind
88

99
#2466: Didn't find class "java.nio.file.Path" below Android api 26
1010
(reported by KevynBct@github)
11+
#2467: Accept `JsonTypeInfo.As.WRAPPER_ARRAY` with no second argument to
12+
deserialize as "null value"
13+
(contributed by Martin C)
1114
1215
2.10.0.pr3 (17-Sep-2019)
1316

src/main/java/com/fasterxml/jackson/databind/jsontype/impl/AsArrayTypeDeserializer.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ protected Object _deserialize(JsonParser p, DeserializationContext ctxt) throws
113113
p = JsonParserSequence.createFlattened(false, tb.asParser(p), p);
114114
p.nextToken();
115115
}
116+
// [databind#2467] (2.10): Allow missing value to be taken as "just use null value"
116117
if (hadStartArray && p.currentToken() == JsonToken.END_ARRAY) {
117118
return deser.getNullValue(ctxt);
118119
}

src/test/java/com/fasterxml/jackson/databind/jsontype/TestTypedDeserialization.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public Cat(@JsonProperty("furColor") String c) {
5757
public void setName(String n) { name = n; }
5858
}
5959

60-
// for [JACKSON-319] -- allow "empty" beans
60+
// Allow "empty" beans
6161
@JsonTypeName("fishy")
6262
static class Fish extends Animal
6363
{
@@ -68,6 +68,7 @@ public Fish()
6868
}
6969
}
7070

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

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

278+
// [databind#2467]
276279
public void testTypeAsArrayWithCustomDeserializer() throws Exception
277280
{
278281
ObjectMapper m = new ObjectMapper();

0 commit comments

Comments
 (0)