jackson-module-scala
jackson-module-scala copied to clipboard
investigate Map serialization test that fails with Scala 3
Passes with Scala 2.
- https://github.com/FasterXML/jackson-module-scala/blob/master/src/test/scala-2.%2B/com/fasterxml/jackson/module/scala/ser/MapScala2SerializerTest.scala
The issue appears to relate to the anonymous class generated for the wrapper val.
val wrapper = new {
val map = Map.apply[String, MapValueBase]("Double" -> MapValueDouble(1.0), "String" -> MapValueString("word"))
}
If I declare a case class that wraps the map, the test passes.
The issue appears to be that when the anonymous class is used then the Java annotations on MapValueBase are not picked up by the jackson code (that uses Java reflection to work out the type information).