Closed GoogleCodeExporter closed 9 years ago
You could create a helper method that returns a JsonObject sorted by keys. It
could even be recursive.
We don't want to make this change because some applications depend on
preserving the order that keys and values are returned.
Original comment by limpbizkit
on 2 Sep 2012 at 9:26
I created a recursive method to sort JsonObjects. It works for Maps (and
Objects). I don't see how it could sort Sets though.
Introducing another flag on the builder to trigger sorting of Maps and Sets
would not change the behavior if its default was false.
Original comment by th.kiesl...@gmail.com
on 11 Sep 2012 at 2:11
I agree. I've worked with other json libraries in other languages (e.g., perl),
and having the ability (optionally, of course) to sort by keys is very useful
in some cases. I'm currently trying to do this myself, and I'm finding I have
to write the code by hand.
Original comment by paul.cle...@steeleye.com
on 18 Dec 2014 at 5:18
Original issue reported on code.google.com by
th.kiesl...@gmail.com
on 23 Aug 2012 at 12:51