0

This is an issue I am trying to solve for work. We are using the Json Parser that comes part of the Vert.x library for Java.

I need a way to serialize json, so when the generated code is done o in alphabetical order, as the json is going to used for a list of rules for our application.

Since the rule file is over 2000 lines, I want to use a json generator so the rule file is easier to maintain, however it needs to be alphabetically sorted otherwise it will be difficult to read in a PR.

I have tried a few attempts to configure the underlining Jackson Serializer to enable sorting, but so far it has not generated the Json in an alphabetical order.

needoriginalname
  • 703
  • 3
  • 9
  • 27
  • 1
    If you add an example of your input and the expected output it would make it easier for people to understand what you want to achieve. For me, it's not clear if you want the fields of a JSON object to be serialized alphabetically or if it's a JSON array that should be ordered based on some property of its items. – Bruno Marco Visioli Feb 24 '23 at 18:50
  • Does this answer your question? [Jackson's SORT\_PROPERTIES\_ALPHABETICALLY for Map](https://stackoverflow.com/questions/48986100/jacksons-sort-properties-alphabetically-for-map) – maraca Feb 24 '23 at 20:06

0 Answers0