Bob*_*Bob 1 scala playframework
我需要在Scala and Play框架中创建以下JSON对象,但遇到了麻烦:
{"employees":[
{"firstName":"John", "lastName":"Doe"}
]}
Run Code Online (Sandbox Code Playgroud)
用于创建对象的数据来自html表单(已实现)。到目前为止,我的代码创建了以下内容:
val json: JsValue = Json.toJson(formContent)
//returns = {"firstName":"John", "lastName":"Doe"}
Run Code Online (Sandbox Code Playgroud)
如何将关键的“员工”添加到该对象?
谁能帮我?
谢谢