0

I have a class that looks something like

case class A (id: Int, name: String, marks: Map[Int, List(Long, Long)])

I am using Jackson to serialize and store the objects in a database and read them back. However, when I deserialize it the Map is Map[String, List(Int, Int)].

I could get the keys deserialized correctly by using @JsonDeserialize(keyAs: classOf[Integer]) but I can't get the values to deserialize correctly.

tharindu_DG
  • 8,900
  • 6
  • 52
  • 64
harshvardhan.agr
  • 165
  • 1
  • 12
  • Please checkout https://github.com/FasterXML/jackson-module-scala/wiki/FAQ and related examples here: https://github.com/FasterXML/jackson-module-scala/blob/master/src/test/scala/com/fasterxml/jackson/module/scala/deser/PrimitiveContainerTest.scala – Sudheer Aedama Jan 05 '17 at 02:58
  • @VenkatSudheerReddyAedama Already visited that link. I tried `@JsonDeserialize(contentAs: classOf[List[(Long, Long)]])` but it doesn't seem to work – harshvardhan.agr Jan 05 '17 at 04:22

0 Answers0