Json Play框架中的读取和验证问题

Json Play框架中的读取和验证问题,json,playframework,Json,Playframework,1) 我可以创建复杂的读取,如下所示: implicit val locationReads: Reads[Location] = ( (JsPath \ "lat").read[Double] and (JsPath \ "long").read[Double] )(Location.apply _) val improvedNameReads = (JsPath \ "name").read[String](minLength[String](2)) “和”的定义在哪里?我查

1) 我可以创建复杂的读取,如下所示:

implicit val locationReads: Reads[Location] = (
  (JsPath \ "lat").read[Double] and
  (JsPath \ "long").read[Double]
)(Location.apply _)
val improvedNameReads =
  (JsPath \ "name").read[String](minLength[String](2))
“和”的定义在哪里?我查找了play.libs.api.functional.syntax.\但在文档中找不到这个包

2) 在上面的代码中,(JsPath \“lat”).read[Double]将返回另一个JsPath。“and”如何使用这个JsPath并将其与(JsPath\“long”)相结合。阅读[Double]/

3) 我可以按如下方式创建自定义验证:

implicit val locationReads: Reads[Location] = (
  (JsPath \ "lat").read[Double] and
  (JsPath \ "long").read[Double]
)(Location.apply _)
val improvedNameReads =
  (JsPath \ "name").read[String](minLength[String](2))
在哪里定义了Reads.minLength?我在Reads.scala中查找了它,但在那里找不到。

它被称为

应用函子

下面是对具体实现JSON格式的说明:

您可以在internet上找到更多信息,如下所示:

您的代码使用
产品中编码的
。scala


我想我理解了第三个疑问-read被定义为
read[T](隐式r:Reads[T]):Reads[T]
。所以minLength是要读取的参数,也就是说,它是'r'。我说的对吗?另外,find minLength的定义是