Closed wsf1990 closed 7 years ago
When I use spray-json like what example show:
case class MyList[A](name: String, items: List[A]) object MyListProtocol extends DefaultJsonProtocol { implicit def myListFormat[A: JsonFormat] = jsonFormat2(MyList.apply[A]) } import MyListProtocol._ MyList[Int]("wsf", List(1, 2, 3)).toJson
It took an error and the stack is
Error:(46, 51) Cannot find JsonWriter or JsonFormat type class for MyList[Int] val json3 = MyList[Int]("wsf", List(1, 2, 3)).toJson ^
resolved it, I added the import DefaultJsonProtocol._ to the code which must be remove.
import DefaultJsonProtocol._
Hi @wsf1990. So it works for you? Could you please close the issue then?
When I use spray-json like what example show:
It took an error and the stack is