Skip to content

Reject missing commas between hash entries - #395

Closed
Narek-Khachikyan wants to merge 1 commit into
jmespath:developfrom
Narek-Khachikyan:fix/hash-entry-separators
Closed

Narek-Khachikyan wants to merge 1 commit into
jmespath:developfrom
Narek-Khachikyan:fix/hash-entry-separators

Conversation

@Narek-Khachikyan

Copy link
Copy Markdown

Summary

search("{a: foo b: bar}", {"foo": 1, "bar": 2}) succeeds and returns {"a": 1, "b": 2}.

_parse_multi_select_hash loops into another key/value entry whenever the next token is neither comma nor closing brace, omitting a required separator check.

Expected: Compilation raises ParseError: adjacent key/value entries require a comma.

- allow another key without a comma
+ require a comma before the next entry

Evidence

JMESPATH_TEST=tests/compliance/hash_separators.json .tox/campaign/bin/python -m pytest tests/test_compliance.py -q --tb=short detects the baseline error and passes with the fix; the full pytest suite with branch coverage passes.

Merge Danger

Door: two-way. Focused correction with regression tests; no new API.

Blast Radius: parsing.

@Narek-Khachikyan Narek-Khachikyan closed this by deleting the head repository Nov 9, 2026
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.

1 participant