Skip to content

Fix JSONPath syntax error with in filter after other filters - #3999

Closed
caglareker wants to merge 1 commit into
alibaba:mainfrom
caglareker:fix/issue-3997-bug-jsonpath-syntax-error-when-other-fil
Closed

caglareker wants to merge 1 commit into
alibaba:mainfrom
caglareker:fix/issue-3997-bug-jsonpath-syntax-error-when-other-fil

Conversation

@caglareker

Copy link
Copy Markdown

Summary

Fix a parser error that occurred when using an 'in' filter in combination with other filters in JSONPath expressions. The parser was unconditionally requiring a closing parenthesis after parsing filters, which caused syntax errors when the 'in' filter's own parentheses were present.

Changes

Modify the filter parsing logic in JSONPathParser to only enforce the closing parenthesis requirement when the filter expression itself is wrapped in parentheses. This allows 'in' filters with their own parenthetical syntax to work correctly after other filter conditions.

Testing

Add test cases validating:

  1. An 'in' filter used after other filter conditions (e.g., @.field=='value' && @.type in ('01','04'))
  2. An 'in' filter used before other filter conditions

Both scenarios now parse and evaluate correctly.

Fixes #3997

When parsing filter expressions, the parser was unconditionally requiring
a closing parenthesis even when the filter wasn't wrapped in parentheses.
This caused errors when an 'in' filter followed other filter conditions,
since the 'in' filter has its own parenthetical syntax.

Only enforce the closing parenthesis requirement when the filter itself is
wrapped in parentheses.
@CLAassistant

CLAassistant commented Feb 26, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@caglareker

Copy link
Copy Markdown
Author

My bad, I can't sign the CLA. Closing this one!

@caglareker caglareker closed this Feb 26, 2026
@jujn

jujn commented Feb 28, 2026 •

Copy link
Copy Markdown
Collaborator

LGTM. Thank you for your contribution! If you're really unable to sign the CLA, I think we can make an exception and merge it anyway. Please reopen it.

@caglareker

Copy link
Copy Markdown
Author

hey @jujn, i resubmited as #4001 since i already deleted the fork. same exact changes

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.

[BUG] jsonpath syntax error when other filters are followed by 'in' filter

3 participants