`match()` and `search()` accept patterns with an unescaped `}` or `]`

Open Beginner friendly
#46 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

Research direction

Start by locating the match() and search() implementations and their I-Regexp pattern validation. Compare how an unescaped { is rejected with how } and ] are handled, then check the parser tests for these examples. Done means both malformed patterns produce no match, consistent with the reported jsonpath-rfc9535 behavior.

Written by the indexing model from the issue text.

Description

If the pattern given to match() or search() isn't a valid I-Regexp, the result should be "no match". An unescaped
} or ] isn't valid, but both are accepted as ordinary characters:

  • $[?match(@,"}|C")] on ["C","}"] returns ["C","}"]; it should return [].
  • $[?match(@,"]")] on ["]"] returns ["]"]; it should return [].

An unescaped { is already rejected, so only } and ] get through. jsonpath-rfc9535 returns [] for these.

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.