If you take a look at all jsonFormat
signatures you'll that it requires a function, more precisely apply
:
case class TestMe(key: String, value: String)
object MyJsonProtocol extends DefaultJsonProtocol {
implicit val prot = jsonFormat2(TestMe.apply)
}
AND jsonFormat is not a macro function, it's just overloaded, so the number at the end should be equal to the number of args in case class
In this example your case class has two arguments, so you need jsonFormat2
and not jsonFormat4
And also better rename companion object MyJsonProtocol
to TestMe
, this will reduce the explicit import with implicits