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

Added comma for index + step in slice #102

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

elrandira
Copy link

@elrandira elrandira commented May 13, 2022

This is my proposition to add comma in index such as in $..books[1,2] and step in slice such as in $..books[::-1] or $..books[0:3:2]

for the comma in index, the code is similar to handling of comma in fields. #28

For step in slice, all the code was already there, just needed to implement the rule... ¯_(ツ)_/¯

All tests passed + new ones

juliannguyen4 added a commit to aerospike-community/jsonpath-ng that referenced this pull request Sep 12, 2022
@michaelmior
Copy link
Collaborator

@elrandira Sorry for the very long delay. If you're still interested in having this merged and you're able to update the PR, let me know!

@elrandira
Copy link
Author

sure, I'll try in the next days. I am going to need to setup the environment again for this.

@kurtmckee
Copy link

This will conflict with a documented JSONPath syntax for selecting multiple indexes simultaneously:

image

https://goessner.net/articles/JsonPath/index.html#e3

This PR should be closed to avoid introducing conflicting syntax.

@kurtmckee
Copy link

I think I misread this; my interpretation was that this was offering commas as an alternative to colons in slice syntax, but now that I've read the code that doesn't appear to be what's happening here.

I recommend merging #145 first, which heavily parametrizes the test suite. It will make it easier to integrate the tests introduced here.

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 this pull request may close these issues.

None yet

3 participants