In playframework I am trying to write the reads/writes for JSON, along with reactivemongo's BSON handlers for my case class:
import play.api.libs.json._
import reactivemongo.api.bson._
case class SomeThing[T](id: String, name: String, value: T)
object SomeThing {
implicit val stWrites = Json.writes[SomeThing]
implicit val stReads = Json.reads[SomeThing]
implicit val stHander = Macros.handler[SomeThing]
}
Because my case class as a type parameter T, I am getting this compile error currently:
class SomeThing takes type parameters
How can I solve this issue?
You need implicit polymorphic functions:
Later Edit: I dropped the generic example