-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
#4580 added new MapperFeature.SORT_CREATOR_PROPERTIES_BY_DECLARATION_ORDER
to prevent alphabetic sorting from affecting order of Creator properties for serialization (in case of MapperFeature. SORT_CREATOR_PROPERTIES_FIRST
enabled).
This is necessary due to logic of lexicographic (~= "alphabetic") sorting which, as of 2.18, will separately sort Creator properties lexicographically too, if MapperFeature.SORT_PROPERTIES_ALPHABETICALLY
is enabled.
But such sorting makes little sense. Instead, for 3.0, let's leave only 2 settings:
MapperFeature.SORT_PROPERTIES_ALPHABETICALLY
for enabling lexicographic sorting, andMapperFeature.SORT_CREATOR_PROPERTIES_FIRST
for determining how Creator properties are dealt with.
Former (SORT_PROPERTIES_ALPHABETICALLY
) will ONLY have effect if latter (SORT_CREATOR_PROPERTIES_FIRST
) is false. If SORT_CREATOR_PROPERTIES_FIRST
is true, Creator properties are always sorted before any other properties, in declaration order.
NOTE: above is only for handling in absence of explicit ordering by @JsonPropertyOrder
.