1
我沿着Play玩耍! 2.1海岸教程http://mandubian.com/2013/01/13/JSON-Coast-to-Coast/,但無法獲得最平凡的例子。玩!無法找到參數縮減器的隱含值
當我編譯我的項目,我得到一個錯誤:
could not find implicit value for parameter reducer: play.api.libs.functional.Reducer[play.api.libs.json.JsString,B]
我的控制器代碼如下:
package controllers
import play.api._
import play.api.mvc._
import play.api.libs.json._
import play.api.libs.json.Reads._
import play.api.libs.functional.syntax._
object MyController extends Controller{
val validate = (
(__ \ 'title).json.pick[JsString] and
(__ \ 'desc).json.pick[JsString]
).reduce
def test() = Action { implicit request =>
Ok("test")
}
}
缺少什麼我得到這個工作?