I know i
m almost 3 years late to answer, but i am working on an assignment and one of the tasks are to read/write JSON data to a .json file.
Anywho.
I tried to write --> [] <-- in the JSON file which was previously not present since Json data is stored in array format (forgive my wording as it might be wrong), when added brackets, it worked since the file is not empty, just the json array (the data which is no there).