-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
2.19Issues planned at 2.19 or laterIssues planned at 2.19 or later
Milestone
Description
Describe your Issue
Currently @JsonPropertyOrder can only be used with regular (or "true") properties, and it will have no effect on:
- "any properties" specified with
@JsonAnyGetter - "unwrapped properties" that result from
@JsonUnwrapped
It would be good to improve so that at least groups could be ordered, so that f.ex following:
@JsonPropertyOrder({ "id", "unwrapped", "name", "any" })
public class POJO {
public int id;
public String name;
@JsonAnyGetter
protected Map<String, Object> any;
@JsonUnwrapped
protected Values unwrapped;
}
would sort output properties as expected, so unwrapped properties of Values unwrapped would be after id but before name, and "any properties" from Map<> any would be serialized after everything else.
No ordering would be imposed based within "any" or "unwrapped" properties (although @JsonPropertyOrder(alphabetic = true) could be taken into account as well; this would be #518.
Metadata
Metadata
Assignees
Labels
2.19Issues planned at 2.19 or laterIssues planned at 2.19 or later