Skip to content

Conversation

@lmmx
Copy link

@lmmx lmmx commented Aug 20, 2025

This PR adds a feature preserve_order which, when enabled, preserves the order of appearance of fields from the source JSON in objects. It uses IndexMap as a drop-in replacement for HashMap in the ObjectStrategy struct but leaves the required_properties as a HashSet (they remain sorted in the output).

This makes it very useful in some scenarios and hopefully will retain the performance on codspeed benchmarks, which you'd expect since IndexMap is based on the same hash algorithm as HashMap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant