allow file to be written as JSON