A space before a segment is rejected on the right-hand side of a comparison

Open
#43 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
67/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
go
Domain
backend

Research direction

Start by locating the JSONPath parser and the tests for whitespace around query segments; the issue gives two failing expressions and their expected results. Compare how the left and right sides of a comparison are parsed, then add regression cases for both examples. Done means both expressions parse and return the stated objects, consistent with the reported jsonpath-rfc9535 behavior.

Written by the indexing model from the issue text.

Description

A blank before a segment is allowed in a singular query, but not when the query is on the right-hand side of a
comparison.

  • $[?1 == @ .b] on [{"b":1}] is a parse error ("unexpected '.' at position 11"); it should return [{"b":1}].
  • $[[email protected] <= @ .b] on [{"a":1,"b":1}] is a parse error at position 13; it should return the object.

The left-hand side accepts the space; only the right-hand side rejects it. jsonpath-rfc9535 accepts both.

Dominant language
Go
Stars
41
Forks
4
Avg merge
2d 8h
Merged PRs (30d)
3

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from theory/jsonpath

All issues in theory/jsonpath

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.