我有以下的JSON读者播放2.3:播放的Json读取和字符串
import play.api.libs.json._
import play.api.libs.json.Reads._
val airportSearchReads: Reads[String] = (JsPath \ "search").read[String](minLength(3))
,如果我使用一个implicit val
我得到
ambiguous implicit values:
both value uuidReads in trait DefaultReads of type => play.api.libs.json.Reads[java.util.UUID]
and value airportSearchReads in object AirportSearch of type => play.api.libs.json.Reads[String]
match expected type play.api.libs.json.Reads[M]
编译器给我的错误
diverging implicit expansion for type play.api.libs.json.Reads[M]
starting with method ArrayReads in trait DefaultReads
我该如何运作?
这给了我同样的错误不幸 – elmalto 2014-11-03 17:09:27
有你删除您的默许阅读器? (刚刚删除'val airportSearchReads:读取[String] =(JsPath \“search”)。读取[String](minLength(3)'first)。 – 2014-11-04 15:03:03
仍然是同样的问题...解决方案顶部作品虽然,所以我会使用它。非常感谢你的帮助 – elmalto 2014-11-04 19:22:54