Closed swijnands closed 2 years ago
This should definitely be supported. Looks like something weird is happening when we're trying to resolve an actual array to enumerate on.
Facing the same issue, is there a resolution on this?
I am not 100% sure but this could be a fix for issue: In: PathResolver.cs replacing
var segments = pathInfo.Segments;
with
var segments = pathInfo.Segments.Where(segment => segment.IsNotEmpty).ToArray();
I am unsure if this will cause other problems though as I am not familiar with lib yet.
@aslezak , it's hard to tell without testing. I'd really appreciate if you can have a look closer.
nit: Try to avoid Linq as this is performance critical path. In this case the check can be placed inside of for
that is right below the line you mentioned.
Will do as soon as I have some spare time, and yes, I noticed I can do continue; in the loop instead of prefiltering them.
No updates for 5 month - I assume I can grab this :) and it seems I've found a simple solution for the issue. @zjklee please take a look at #488.
Describe the bug
Trying to enumerate an array via a nested object path:
Results in an IndexOutOfRangeException exception.
Expected behavior:
I would expect the same result as when not using a nested path, i.e.
Or, alternatively, if this is not supported: a clearer exception message.
Test to reproduce