Reputation: 592
I need to create the following JSON object in Scala and Play framework, but I am having trouble:
{"employees":[
{"firstName":"John", "lastName":"Doe"}
]}
The data used to create the object comes from a html form (already implemented). So far my code creates the following:
val json: JsValue = Json.toJson(formContent)
//returns = {"firstName":"John", "lastName":"Doe"}
How can I add the the key "employees" to this object?
Can anyone help me?
Thanks
Upvotes: 2
Views: 3116