参考官网:https://www.playframework.com/documentation/2.0.1/ScalaJson
json的操作类似scala.xml._ api的特性
val json: JsValue = Json.parse(jsonString) val json = Json.parse(jsonString)val maybeName = (json \ "user" \ name).asOpt[String]val emails = (json \ "user" \\ "emails").map(_.as[String])
时间: 2024-11-09 19:28:51