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

Is there any way to ignore array order when diffing? #60

Open
sebasijan opened this issue Jan 25, 2022 · 5 comments
Open

Is there any way to ignore array order when diffing? #60

sebasijan opened this issue Jan 25, 2022 · 5 comments

Comments

@sebasijan
Copy link

Say I create a diff for these 2 arrays

var a1 = @"
{
    "items": [
        "one",
        "two"
}";

var a2 = @"
{
    "items": [
        "two",
        "one"
}";

Is there some way of causing the diff to recognise them as the same array, since they only differ in the items' order?

I am using Simple mode for Array diffing

@MaorDavidzon
Copy link

+1 :)

@goldeneye977
Copy link

+1

@MrXander
Copy link

I tried to workaround it like that: sort array and then find diff
example is here
https://github.com/MrXander/json-diff

@AachoLoya
Copy link

AachoLoya commented Jul 10, 2023

Any fix for this yet, other than sorting approach?

@RudiThoeni
Copy link

+1

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

6 participants