Using Scala 2.10 and json4s 3.5.0, I am trying to serialize a map to a JSON string. For example:
implicit val formats = org.json4s.DefaultFormats.withBigDecimal
println(Serialization.write(Map("key" -> new java.math.BigDecimal(1)))
Fails with:
java.lang.RuntimeException: not a primitive class java.math.BigDecimal
I followed [https://stackoverflow.com/a/27847784/901330] but the BigDecimal appears to break it. How do I do this serialization?