Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add JsonNodeFeature.WRITE_PROPERTIES_SORTED for sorting ObjectNode properties on serialization #3965

Closed
cowtowncoder opened this issue Jun 5, 2023 · 0 comments · Fixed by #3998
Labels
2.16 Issues planned for 2.16 node-config Related to JSTEP-7 Node config/feature
Milestone

Comments

@cowtowncoder
Copy link
Member

(note: inspired by #3963)

So, there are ways for alphabetic output of JSON Object keys, for:

  • SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS orders Map keys
  • MapperFeature.SORT_PROPERTIES_ALPHABETICALLY orders POJO properties

but there is nothing to force this on ObjectNode (JsonNode subtype). It should be relatively simple to add this, both for general usage and possibly to help with "Canonical JSON" output.

@cowtowncoder cowtowncoder added to-evaluate Issue that has been received but not yet evaluated 2.16 Issues planned for 2.16 node-config Related to JSTEP-7 Node config/feature and removed to-evaluate Issue that has been received but not yet evaluated labels Jun 5, 2023
@cowtowncoder cowtowncoder changed the title Add new JsonNodeFeature for sorting ObjectNode properties on serialization Add JsonNodeFeature.WRITE_PROPERTIES_SORTED for sorting ObjectNode properties on serialization Jun 19, 2023
@cowtowncoder cowtowncoder added this to the 2.16.0 milestone Jun 19, 2023
cowtowncoder added a commit that referenced this issue Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.16 Issues planned for 2.16 node-config Related to JSTEP-7 Node config/feature
Projects
None yet
1 participant