使用 play framework / scala 创建 Json 很容易。这是一个关于它的例子,
import play.api.libs.json.Json
val json: JsValue = Json.parse("""
{
"user": {
"name" : "toto",
"age" : 25,
"email" : "toto@jmail.com",
"isAlive" : true,
"friend" : {
"name" : "tata",
"age" : 20,
"email" : "tata@coldmail.com"
}
}
}
""")
欲了解更多信息和来源:http ://www.playframework.com/documentation/2.1.1/ScalaJson