How to add a key to a JSON object
I need to create the following JSON object in Scala and Play Framework:
{"employees":[
{"firstName":"John", "lastName":"Doe"}
]}
The data used to create the object comes from an 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?