Nel mio codice Scala Ho un oggetto JSON consistente dati e-mailCome aggiungere un oggetto JSON a un array JSON usando scala play?
val messages = inboxEmail.getMessages();
var jsonArray = new JsArray
for(inboxMessage <- messages)
{
...
...
val emailJson = Json.obj("fromAddress" -> fromAddressJsonList, "toAddress" -> toAddressJsonList, "ccAddress" -> ccAddressJsonList, "bccAddress" -> bccAddressJsonList, "subject" -> emailMessage.getSubject().toString(), "message" -> Json.toJson(emailMessageBody))
ho bisogno di aggiungere emailJson al jsonArray durante ogni ciclo
ho provato
jsonArray.+:(emailJson)
e
jsonArray.append(emailJson)
ma ricevendo array vuoto
cosa devo usare qui per aggiungere JsonObject nella matrice JSON
Grazie per la tua preziosa risposta – James