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

fix default slice start in parser #559

Merged
merged 1 commit into from
Oct 26, 2024

Conversation

V0ldek
Copy link
Member

@V0ldek V0ldek commented Oct 25, 2024

Short description

According to the spec the start of a slice when not explicitly specified depends on the sign of the step. The current implementation always used FromStart(0), which is correct for forward steps, but for backward steps it's supposed to be starting from the end - FromEnd(1).

This affects only rsonpath-syntax.

Issue

Resolves: #546

Checklist

All of these should be ticked off before you submit the PR.

  • I ran just verify locally and it succeeded.
  • Issue was given go ahead and is linked above OR I have included justification for a minor change.
  • Unit tests for my changes are included OR no functionality was changed.

@V0ldek V0ldek force-pushed the v0ldek/#546-parser-incorrect-default-start branch from 35428e9 to 090f341 Compare October 26, 2024 12:19
According to the spec the start of a slice when not explicitly specified
depends on the sign of the step. The current implementation always used
FromStart(0), which is correct for forward steps, but for backward steps
it's supposed to be starting from the end - FromEnd(1).

This affects only `rsonpath-syntax`.
@V0ldek V0ldek force-pushed the v0ldek/#546-parser-incorrect-default-start branch from 090f341 to b75a524 Compare October 26, 2024 12:29
@V0ldek V0ldek merged commit 094ae20 into main Oct 26, 2024
50 checks passed
@V0ldek V0ldek deleted the v0ldek/#546-parser-incorrect-default-start branch October 26, 2024 13:26
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.

Incorrect default value for start when step is negative in the slice selector
1 participant