Am having a trait
trait Role[A, B] {
val _id: Option[A] = None
val value: Option[List[B]] = None
val id: Option[String] = None
}
And the case class extending the trait
case class User (value1: Option[Role] = None, value2: Option[String] = None) extends Role
object User {
implicit val jsonFormatter: Format[User] = Json.format[User]
}
And it is not compiling because of the error, "No Json formattor for Role".
I tried several examples available in stackoverflow, on json formatter for traits Nothing gets worked.