How to add a key to a JSON object
16:13 20 Jul 2016

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?

scala playframework play-json