You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[REQ][java][jackson] Add JsonPropertyOrder annotation for Spring Boot generator #23933
Jackson 3 now by default sorts properties properties alphabetically instead of following the logical order of the generated classes.
This seems to be only fixable by adding the JsonPropertyOrder annotation (disabling the alphabetical sort in Jackson does nothing).
In the pull request related to issue 3629, this was done for the JAX-RS server, but not for any other Java generators.
I looked into similar issues, issue 3629, issue 3441 and what i understood is that i have to modify the mustache template of JavaSpring for POJO, basically POJO.mustache, adding @JsonPropertyOrder and in the same file I also need to add JSON_PROPERTY_ constant declarations per field inside {{#jackson}} … {{/jackson}} as these constants are what the @JsonPropertyOrder annotation references. And also have to add the proper import for com.fasterxml.jackson.annotation.JsonPropertyOrder in importMapping as discussed in issue 3441. Then have to generate test snapshot if that is working or not. Please correct me if I am wrong on any of these
Activity
thesauravpoddar commentedon Jun 3, 2026
I would like to work on this.
petervandenbroek commentedon Jun 3, 2026
@thesauravpoddar I'm working on a PR myself as well, but please go ahead if you want to do it :)
thesauravpoddar commentedon Jun 3, 2026
I looked into similar issues, issue 3629, issue 3441 and what i understood is that i have to modify the mustache template of JavaSpring for POJO, basically POJO.mustache, adding @JsonPropertyOrder and in the same file I also need to add JSON_PROPERTY_ constant declarations per field inside {{#jackson}} … {{/jackson}} as these constants are what the @JsonPropertyOrder annotation references. And also have to add the proper import for com.fasterxml.jackson.annotation.JsonPropertyOrder in importMapping as discussed in issue 3441. Then have to generate test snapshot if that is working or not. Please correct me if I am wrong on any of these
thesauravpoddar commentedon Jun 5, 2026
I opened a pull request can you please check that?
petervandenbroek commentedon Jul 3, 2026
@thesauravpoddar where is this pull request, can you link it here?
thesauravpoddar commentedon Jul 3, 2026
#23957
This is the pull request