Posted on Leave a comment

Jackson ObjectMapper – specify serialization order of object properties

// ensure that "id" and "name" are output before other properties
@JsonPropertyOrder({ "id", "name" })
// order any properties that don't have explicit setting using alphabetic order
<span data-mce-type="bookmark" style="display: inline-block; width: 0px; overflow: hidden; line-height: 0;" class="mce_SELRES_start"></span>@JsonPropertyOrder(alphabetic=true)
Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.