I am trying to deserialize this json:

{ "id" : 1, "attributes" : { "weight" : 120, "age": 20 } }

Works well with this case class:

case class Record(id: Int, attributes: Map[String, Int])


However the data has an empty string when there are no attributes:

{"id" : 2, "attributes" : ""}

Deserialization fails with this message:

Can not instantiate value of type scala.collection.immutable.Map from 
String value (''); no single-String constructor/factory method


Please suggest how to get past this issue.  The package version we use is:

"com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.2.2"


Thanks,
Anand.

-- 
You received this message because you are subscribed to the Google Groups 
"jackson-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to