Add write_json to improve compatibility
#381
Open
write_json to improve compatibility
#381