--I hit the following compile error when using Spray Json for nested classes:
Sbt Compile Error:(10, 48) could not find implicit value for evidence parameter of type:
TodoMarshalling.this.JF[io.github.scalahackers.todo.RequestPayload] implicit val standardTodoFormat = jsonFormat9(TodoTxs.apply) ^
Here is code:
trait TodoMarshalling extends SprayJsonSupport with FlowMaterializerProvider with DefaultJsonProtocol { implicit val standardTodoFormat = jsonFormat9(TodoTxs.apply) implicit val todoUpdateFormat = jsonFormat8(TodoUpdate.apply) def todoFormatFor(baseUrl: String) = new RootJsonFormat[TodoTxs] { def read(json: JsValue) = standardTodoFormat.read(json) def write(todo: TodoTxs) = { val fields = standardTodoFormat.write(todo).asJsObject.fields JsObject(fields.updated("url", JsString(baseUrl + '/' + todo.id))) } }
}
case class TodoTxs(id: String, extid: String = "", request: RequestPayload, state: String = "",
substate: String = "", response: String = "", priority: Int = 0, starttime: String = "", endtime: String = "")case class RequestPayload(reqtype: String, reqtask: String)
Appreciate any advice.
You received this message because you are subscribed to the Google Groups "spray.io User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spray-user+...@googlegroups.com.
Visit this group at https://groups.google.com/group/spray-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/spray-user/2e0a9072-32b2-4dc9-92fc-45789decfc5c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.