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

Path is missing the array index #17

Closed
BrightSoul opened this issue Nov 9, 2021 · 3 comments · Fixed by #26
Closed

Path is missing the array index #17

BrightSoul opened this issue Nov 9, 2021 · 3 comments · Fixed by #26

Comments

@BrightSoul
Copy link

Hello there, I'm comparing these two objects:

var obj1 = new Projection
{
    Speakers = new [] { new Speaker { Id = 1, Name = "Fizz" } }
};

var obj2 = new Projection
{
    Speakers = new [] { new Speaker { Id = 1, Name = "Buzz" } }
};

var diffs = AnyDiff.Diff(obj1, obj2);

As you can see, The Name property of the first Speaker in the array has a different value.
The resulting Difference object is omitting the 0 index in the path. It's .Speakers.Name but it should be .Speakers[0].Name.
speakers
Without an index in the Path, I can't really tell which of the objects in the array changed.

Thanks,
Moreno

@BrightSoul BrightSoul changed the title Path is missing array index Path is missing the array index Nov 9, 2021
@digitaldirk
Copy link

Hi,

I just started using this library and ran into this issue as well. I saw in this repo's forks, this one: https://github.com/MohammadHadi2031/AnyDiff has implemented a fix for this issue.

Thank you

@MohammadHadi2031
Copy link
Contributor

I will make a PR soon

@digitaldirk
Copy link

I will make a PR soon

Thank you!

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

Successfully merging a pull request may close this issue.

3 participants