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

Inconsistent implementation of array slice #950

Open
luyaor opened this issue Jul 28, 2023 · 0 comments
Open

Inconsistent implementation of array slice #950

luyaor opened this issue Jul 28, 2023 · 0 comments

Comments

@luyaor
Copy link

luyaor commented Jul 28, 2023

How to reproduce:

        String json = "[\"a\", \"b\", \"c\", \"d\", \"e\"]"; // i.e., the json is ["a", "b", "c", "d", "e"]
        Object res = JsonPath.read(json, "$[0:3:2]");
        System.out.println(res); // it prints ["a","b","c"], the expected value is ["a", "c"].

In https://goessner.net/articles/JsonPath/ , it shows JSONPath supports step in array slice operator:

"JSONPath allows the wildcard symbol * for member names and array indices. It borrows the descendant operator '..' from E4X and the array slice syntax proposal [start:end:step] from ECMASCRIPT 4."

So, it is either a bug, or an unimplemented feature.

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