Ok, so json compare didn't work quite as well as I'd hoped.
In our case we have a fairly straightforward json document but that is quite big.
Sorting the json with jq first does help as long as new objects haven't been added in arrays. When a new object has been added in an array, at this point BC consumes rows on the left for the new rows on the right.
e.g. (I'm leaving out all the json operators for readability)
Imagine our json describes tables and columns only
Left
TableA
Right
TableA
So what I want the compare to show is that TableB has been added and TableB\Col1&Col2 is new.
Instead I get a mash of TableC trying to get fixed into TableB. Obviously this is a simple example and in our case it is much worse than this.
In our document each object has a name keyvalue pair and this is what we could use to align (within the tree, so tableC.Col1 = tableC.Col1 not tableB.Col1, then the other keyvalues of that object are compared against each other for changes.
This is becoming more and more of a problem these days as more and more languages used are configuration or domain specific languages which use xml/json to represent the structures and stored in source control and comparing and merging is a bigger and bigger risk area.
Is there any way to deal with this better in the current version of BC (scripting or other methods) or any planned enhancements in this area
Brett
In our case we have a fairly straightforward json document but that is quite big.
Sorting the json with jq first does help as long as new objects haven't been added in arrays. When a new object has been added in an array, at this point BC consumes rows on the left for the new rows on the right.
e.g. (I'm leaving out all the json operators for readability)
Imagine our json describes tables and columns only
Left
TableA
Col1
Col2
TableCCol1
Col2
Right
TableA
Col1
Col2
TableBCol1
Col2
TableCCol1
Col2
So what I want the compare to show is that TableB has been added and TableB\Col1&Col2 is new.
Instead I get a mash of TableC trying to get fixed into TableB. Obviously this is a simple example and in our case it is much worse than this.
In our document each object has a name keyvalue pair and this is what we could use to align (within the tree, so tableC.Col1 = tableC.Col1 not tableB.Col1, then the other keyvalues of that object are compared against each other for changes.
This is becoming more and more of a problem these days as more and more languages used are configuration or domain specific languages which use xml/json to represent the structures and stored in source control and comparing and merging is a bigger and bigger risk area.
Is there any way to deal with this better in the current version of BC (scripting or other methods) or any planned enhancements in this area
Brett
Comment