Returns a JSON validation as a scala.util.Try.
Returns a JSON validation as a scala.util.Try.
the type for the parsing
the JSON validation result
the function to be applied if the results is an error
import scala.concurrent.Future import play.api.libs.json.JsResult def toFuture[T](res: JsResult[T]): Future[T] = Future.fromTry(JsResult.toTry(res))