Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON Difference doesn't work properly when using array of object #71

Open
1adityas opened this issue May 2, 2024 · 0 comments
Open

Comments

@1adityas
Copy link

1adityas commented May 2, 2024

I am using JSON Patches (RFC 6902) to get the difference between Jsons in RFC 6902 format
When I am trying to get the differences between two JSONs, that contains Json array and If there happens to be a value or property of an object present in an array that differs between Jsons, the package is returning the address of the whole object instead of pointing to the particular property or value.

for eg:
json1:
{
"names": [
"name1",
"name2",
"name3"
]
}

json2:

{
"names": [
"name11",
"name2",
"name33"
]
}

I get output which points to path ->
path : "/names/2"
operation: remove
path : "/names/1"
operation: remove
path : "/names/0"
operation: remove

And so on...

Whereas I was expecting the output to not point out to 1st index path (i.e. path: "/names/1") as the value is same in both JSON.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant