How can I provide JsonFormats for a case class that references itself?
I follow this and wrote the following code
case class Item(name: String, desc: Option[String], prices: Array[String], subitems: Option[List[Item]]) import spray.json._ import DefaultJsonProtocol._
and I get the following error message, which I, unfortunately, do not understand.
could not find implicit value for evidence parameter of type Hi.MyJsonProtocol.JF[Option[List[mypkg.Item]]] implicit val menuItemFormat = jsonFormat(Item, "name", "desc", "prices", "subitems") ^
How can i fix this?
source share