Writing JSON files feels rather cumbersome if you load one JSON file, want to make some changes and save it back (locally).
JSON writer requires a flow variable that is “one level above” the path flow variable created from JSON reader, and the file name in an additional column.
JSON Row Combiner and Writer, similar to some of the other nodes, force the creation of an array per row. a merge option is not offered (which obviously would need to fail if a key is duplicated).
having a patch and applying it directly on a local JSON file is not available either.
if you convert a JSON to a table first and add additional columns, you need to convert it back and then have the same issue with the Path requiring a folder.
to bring an additional (arbitrary) example:
you have a local JSON config file like
{
"created_at" : "2011-11-11T11:11:11",
"SQL" : {
"Server" : "serveraddress",
"Port" : 1234,
"Database" : "dbname"
},
"Name" : "Project Name"
}
and you want to add or modify some information and save it back
{
"created_at" : "2011-11-11T11:11:11",
"SQL" : {
"Server" : "serveraddress",
"Port" : 1234,
"Database" : "dbname"
},
"Name" : "Project Name",
"Retention" : {
"archive_on" : "2012-11-11T11:11:11",
"delete_after" : "2016-11-11T11:11:11"
}
}
(yes, I am aware that JSON spec isnt trivial and allows for many different ways of handling, but updating a single file should be made easier)