I have an ArrayList< Map < String, String > >, I want to write a method to create a JSON object from it. The object should look like this:
{
"list":[ {"name": "john",
"partner": "meredith",
...
}
{"name": "harry",
...
}
...
]
}
The documentation of JSONSerializer.toJson(Object o) says o has to be a formatted Collection, but I couldn't find an example. How should I format my arraylist to be qualified as "formatted"?
Thanks!!
Rachel