-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
will-not-fixClosed as either non-issue or something not planned to be worked onClosed as either non-issue or something not planned to be worked on
Description
MapperFeature.SORT_PROPERTIES_ALPHABETICALLY is no longer respected by record method based JSON properties
Version information
2.15
To Reproduce
final var mapper =
Jackson.mapperBuilder()
.enable(SerializationFeature.INDENT_OUTPUT)
.enable(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY)
.build();
record R(String c, String b, String e) {
@JsonProperty
String a() {
return "4";
}
}
System.out.println(mapper.writeValueAsString(new R("1", "2", "3")));Output:
{
"b" : "2",
"c" : "1",
"e" : "3",
"a" : "4"
}
The property 'a' in the example below comes at the last place:
Expected behavior
All record properties must be serialized the natural order
Metadata
Metadata
Assignees
Labels
will-not-fixClosed as either non-issue or something not planned to be worked onClosed as either non-issue or something not planned to be worked on