Hello,
I'm taking a JSON feed which I'm then unmarshalling. I'm using spray-json and a custom case class to do this.
The problem I'm having is being able to to extract one entries keyname which has been prefixed with an ampersand, where as the other keys are easily coped with, e.g.,
// data
{..., "@id" : "string", ...}
// class
case class Response(..., `@id`: String, ...)
The error I get when I run my tests from fixtures is this. Renaming the keyname, in the data and the class to 'id', doesn't create the error and I've not found much on the web agianst this specific problem.
Caused by java.lang.RuntimeException: Cannot automatically determine case class field names and order for 'spray.example.domain.Response', please use the 'jsonFormat' overload with explicit field name specification
So far I've only found examples for adding custom unmarshallers against values instead of keynames. Is there way to seralise the data using a custom unmarsaller against keyname? If so, how might this be done?
Thanks all