¡Extraño! Mi Intellij IDEA 12 no reconoció la importación y cuando optimicé las importaciones
import play.modules.reactivemongo.json.BSONFormats._
fue eliminado lo que creó el error.
También se podría crear un objeto de formato personalizado para traducir BSONObjectID a json.
implicit object BSONObjectIDFormat extends Format[BSONObjectID] {
def writes(objectId: BSONObjectID): JsValue = JsString(objectId.toString())
def reads(json: JsValue): JsResult[BSONObjectID] = json match {
case JsString(x) => {
val maybeOID: Try[BSONObjectID] = BSONObjectID.parse(x)
if(maybeOID.isSuccess) JsSuccess(maybeOID.get) else {
JsError("Expected BSONObjectID as JsString")
}
}
case _ => JsError("Expected BSONObjectID as JsString")
}
}
Pero la importación es suficiente en este caso.