Skip to content

Commit

Permalink
Merge branch '2.13' into 2.14
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Apr 29, 2022
2 parents 08915ea + c123b33 commit e073287
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,21 @@ public void serialize(Bean838 value, JsonGenerator gen,
}
}

// [databind#1806]
static class Bean1806 {
@JsonValue public List<Elem1806> getThings() {
return Collections.singletonList(new Elem1806.Impl());
}
}

@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.WRAPPER_OBJECT)
@JsonSubTypes(@JsonSubTypes.Type(value = Elem1806.Impl.class, name = "impl"))
interface Elem1806 {
final class Impl implements Elem1806 {
public int value = 1;
}
}

// [databind#2822]
@JsonPropertyOrder({ "description", "b" })
static class A2822 {
Expand Down Expand Up @@ -322,6 +337,13 @@ public void testJsonValueWithCustomOverride() throws Exception
assertEquals("42", mapper.writeValueAsString(INPUT));
}

// [databind#1806]
public void testCollectionViaJsonValue() throws Exception
{
assertEquals("[{\"impl\":{\"value\":1}}]",
MAPPER.writeValueAsString(new Bean1806()));
}

// [databind#2822]
public void testFormatWithJsonValue() throws Exception
{
Expand Down

0 comments on commit e073287

Please sign in to comment.