jackson-databind icon indicating copy to clipboard operation
jackson-databind copied to clipboard

`@JsonPropertyOrder(alphabetic = true)` does not include `@JsonAnyGetter`

Open lathspell opened this issue 9 years ago • 10 comments

The JsonPropertyOrder annotation does only sort the explicitly defined properties of an object, additional properties which may be stored using the JsonAnySetter/JsonAnyGetter annotations are not taken into account and just appended at the end.

This is not a bug as the order of properties in a JSON object should never be of any importance but when dumping objects into logs or diffing JSON outputs in unit tests it would be nice if the ordering would be alphabetic for all properties.

(if a TreeMap is used for the additionalProperties at least they for themselves are orderd alphabetic too)

lathspell avatar Aug 07 '14 16:08 lathspell