I have the following piece of code:
def fromString[T <: AnyRef](str: String)(implicit m: Manifest[T]): T = {
val json = parse(str)
json.extract[T](formats,m)
}
I also have a case class that is defined as such:
case class Points(pts: Seq[Point])
case class Point(date: LocalDate, value: Double)
When I try to make the function call:
fromString[Points]
I get an error stating:
expected field or array
Near: \",\"value\":2.0}]}"
So normally this would imply that the JSON string is malformatted, but I confirmed that it is valid JSON. (see input string below)
"{\"pts\":[{\"date\":\"12-31-1969\",\"value\":1.0},{\"date\":\"01-31-1970\",\"value\":2.0}]}"
I have tried implementing a CustomSerializer and put it in scope of the implicit formats, but still no luck.
What am I missing?