-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove MapperFeature.SORT_CREATOR_PROPERTIES_BY_DECLARATION_ORDER
from 3.0; make logic default
#4589
Comments
@pjfanning Above is meant to basically change defaults to sane(r): Record/Case/Data Creator props in declaration order first; then alphabetic (lexicographic) for the rest. And with just 2 |
…ON_ORDER`, change default sorting logic
Much cleaner now. 👍🏼 |
@JooHyukKim no problem, I'm very familiar with this part. |
@pjfanning @JooHyukKim It looks like this change did not cause additional breaks for master/3.0 dependencies. It should basically bring default behavior of sorting closer to 2.x (still sorts non-Creator properties lexicographically; but leaves Creator properties in declaration order, preceding other properties [unless |
#4580 added new
MapperFeature.SORT_CREATOR_PROPERTIES_BY_DECLARATION_ORDER
to prevent alphabetic sorting from affecting order of Creator properties for serialization (in case ofMapperFeature. 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. IfSORT_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
.The text was updated successfully, but these errors were encountered: