Skip to content

Remove MapperFeature.SORT_CREATOR_PROPERTIES_BY_DECLARATION_ORDER from 3.0; make logic default #4589

@cowtowncoder

Description

@cowtowncoder

#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, and
  • MapperFeature.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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.xIssues to be only tackled for Jackson 3.x, not 2.x

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions