I have an issue in Scala I'm really stuck on. I know the title is probably more confusing so let me try to explain it as easy as possible. Imagine I have an abstract class
called Repo
. This class describes a couple of methods on them, most of them are already implemented. The class Repo
looks like this:
abstract class Repo[T](name: String) {
implicit def collection(implicit db: DefaultDB): JSONCollection =
db.collection[JSONCollection](name)
def findOne(selector: JsObject)(implicit collection: JSONCollection): Future[Option[T]] = {
collection.find(selector).one[T]
}
...
}
A basic implementation of this class would look like this:
import models.Models.Resume._
object ResumeRepo extends Repo[Resume]("resumes")
Now if I try to compile this, it gives me an error, saying: "No Json serializer found for type T. Try to implement an implicit Writes or Format for this type." which is odd because I explicitly include the implicit Format
in the ResumeRepo
implementation class. Why is this error displaying?