我想知道向Playframework Json Reader/Writer传递隐式消息的最好方法是什么
http://www.playframework.com/documentation/api/2.0/scala/play/api/libs/json/Reads.html
换句话说,我希望能够做这样的事情:
def reads(json: JsValue)(implicit configuration: TenantConfiguration): JsResult[User]但是我不能这样做,因为读取特征不匹配
发布于 2013-06-06 23:42:36
你不能改变ReadsT,这是很明显的。我会简单地创建我自己的读取函数,比如?
def customReads[T](json:JsValue)(implicit reads: Reads[T], configuration: TenantConfiguration): JsResult[T] = ...https://stackoverflow.com/questions/16958144
复制相似问题