array to json online code example
Example 1: arraylist to json array
ArrayList<String> list = new ArrayList<String>();
list.add("foo");
list.add("baar");
JSONArray jsArray = new JSONArray(list);
Example 2: online json viewer
Online JSON beautifier: https://codebeautify.org/jsonviewer
JSON pretty print in Python:
import json
your_json = '["foo", {"bar":["baz", null, 1.0, 2]}]'
parsed = json.loads(your_json)
print(json.dumps(parsed, indent=4, sort_keys=True))