Have 2 big JSON (~GB) files created from same source by code, that should work exactly same, but there should be some small differences sometimes.
Want to be sure both conversions did same job and properly. Made small project to convert JSONs to kind of CSV with path to elements and its content (single value or arrays/objects). Planning to compare "CSV" JSONs by any text diff then.
Source (on my GitHub) is quite long for limitted space here and is not main part of the question. It is not working properly generally (tested on a big simple JSON and another shown here, did not want to use recursion, code is quite tricky).
Example export of JSON Data Set Sample # Example 4 to ilustrate my idea when ID set to type, Horizontal format and Sort All looks like:
batters\batter\Blueberry\ id 1003
batters\batter\Devil's Food\ id 1004
batters\batter\Chocolate\ id 1002
batters\batter\Regular\ id 1001
donut\ id 0001 name Cake ppu 0.55
topping\Glazed\ id 5002
topping\Chocolate with Sprinkles\ id 5006
topping\Chocolate\ id 5003
topping\Maple\ id 5004
topping\None\ id 5001
topping\Powdered Sugar\ id 5007
topping\Sugar\ id 5005
Is it a good idea or are there any better options ?
Processed JSON preview:
{ "type": "donut",
"id": "0001", "name": "Cake", "ppu": 0.55,
"batters": { "batter": [ {
"id": "1001", "type": "Regular"
},{
"id": "1002", "type": "Chocolate"
},{
"id": "1003", "type": "Blueberry"
},{
"id": "1004", "type": "Devil's Food"
}]},
"topping": [ {
"id": "5001", "type": "None"
},{
"id": "5002", "type": "Glazed"
},{
"id": "5005", "type": "Sugar"
}, ...