向playframework传递隐式JSON读取
我想知道向Playframework Json读写器传递隐式Json的最佳方式是什么 换句话说,我希望能够做到以下几点:向playframework传递隐式JSON读取,json,playframework-2.0,implicit,Json,Playframework 2.0,Implicit,我想知道向Playframework Json读写器传递隐式Json的最佳方式是什么 换句话说,我希望能够做到以下几点: def reads(json: JsValue)(implicit configuration: TenantConfiguration): JsResult[User] 但是我不能这样做,因为Reads特征不匹配你不能改变Reads[t],这很清楚。 我只需要创建自己的reads函数,比如 def customReads[T](json:JsValue)(implici
def reads(json: JsValue)(implicit configuration: TenantConfiguration): JsResult[User]
但是我不能这样做,因为Reads特征不匹配你不能改变Reads[t],这很清楚。 我只需要创建自己的reads函数,比如
def customReads[T](json:JsValue)(implicit reads: Reads[T], configuration: TenantConfiguration): JsResult[T] = ...