FasterXML / FasterXML/jackson-databind

`@JsonAppend` not following sort order specified in `@JsonPropertyOrder`

Open
#1,827 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
3.7k
Forks
1.5k
Avg merge
3d 6h
Merged PRs (30d)
28

Description

`@JsonAppend` javadoc claims to respect `@JsonPropertyOrder` but I'm not seeing that in version 2.9.2:

Simple test case:

```
@Test
public void testAppendOrder() throws Exception {

AppendOrder data = new AppendOrder();
ObjectMapper om = new ObjectMapper();
String json = om.writer().withAttribute("@id", "1").writeValueAsString(data);
System.out.println(json);
assertTrue(json.indexOf("foo") > json.indexOf("@id"));
}

@JsonAppend(attrs = {
@JsonAppend.Attr(value="@id", include= JsonInclude.Include.NON_EMPTY),
})
@JsonPropertyOrder(value = {"@id", "foo"})
private static class AppendOrder {
public String foo = "foo";
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.