You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thanks for the very useful library, I'm using it in a client project. I haven't found another implementation that is as handy and low-ceremony as yours 👍
I just found a little issue in sub-collections, let me explain it.
If you have an original object: { "Children": [ { "Name": "Alice" } ] }
and a modified one: { "Children": [ { "Name": "Alice" }, { "Name": "Bob" } ] }
If I do a GenerateDiff and then PatchObject one the original object, I get this: { "Children": [ {"Name": "Alice"}, null ] }
I have addressed the issue by making 2 small changes in the Patch method:
'return array' in the block that deals with arrays, 'return sourceObj' in the block that deals with objects, and remove the 'return sourceJson' at the end of the method. Problem is then fixed, and I think the code is a bit less confusing as well.
Attached is a small unit test that highlights the issue.
Would be awesome if you could integrate this fix, thx :)
@stiiifff I just updated Nuget.org with a version that should address this problem. Could you check it out?
I applied a patch that @kkostov submitted 5 months ago.
Best!
Hi Khalid,
First of all, thanks for the very useful library, I'm using it in a client project. I haven't found another implementation that is as handy and low-ceremony as yours 👍
I just found a little issue in sub-collections, let me explain it.
If you have an original object:
{ "Children": [ { "Name": "Alice" } ] }
and a modified one:
{ "Children": [ { "Name": "Alice" }, { "Name": "Bob" } ] }
If I do a GenerateDiff and then PatchObject one the original object, I get this:
{ "Children": [ {"Name": "Alice"}, null ] }
I have addressed the issue by making 2 small changes in the Patch method:
'return array' in the block that deals with arrays, 'return sourceObj' in the block that deals with objects, and remove the 'return sourceJson' at the end of the method. Problem is then fixed, and I think the code is a bit less confusing as well.
Attached is a small unit test that highlights the issue.
Would be awesome if you could integrate this fix, thx :)
ObjectDiffPatchArrayIssue.zip
The text was updated successfully, but these errors were encountered: