FasterXML/jackson-module-scala — Issue #21: Maintain ordering when serializing a ListMap or LinkedHashMap
Author: devth
Created: 2012-02-25 18:30:10+00:00
State: open

I'm trying to output a sorted map while maintaining sort order.

On the repl, I verified sort with:

```scala
scala> val m = ListMap(Map((5, 1), (2, 33), (7, 22), (8, 333)).toList.sortBy(-_._2):_*)
m: scala.collection.immutable.ListMap[Int,Int] = Map(8 -> 333, 2 -> 33, 7 -> 22, 5 -> 1)
```

When I serialize this, I get:

```
{
2: 33,
5: 1,
7: 22,
8: 333
}
```

Same thing when using a LinkedHashMap.