quoted-string grammar seems inconsistent with official parser behavior for empty string
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 62/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Stale
- Domain
- documentation
Research direction
Locate the JMESPath documentation page containing the quoted-string EBNF and compare its 1* quantifier with the parser behavior described here. Update the grammar to allow zero or more characters, then verify that the rendered documentation includes the empty string case.
Written by the indexing model from the issue text.
Description
Title
Grammar for quoted-string excludes empty string, but official parser allows ""
Description
In the JMESPath documentation, the grammar for quoted-string is currently defined as:
quoted-string = quote 1*(unescaped-char / escaped-char) quote
This definition requires at least one character between the quotes, which formally excludes the empty string "".
However, this appears to be inconsistent with the actual behavior of the official JMESPath parser.
Actual Behavior
The official JMESPath implementation (including the online interpreter on https://jmespath.org/) allows empty strings as object keys.
For example, given the following JSON input:
{
"": 123
}
The expression:
""
correctly evaluates to:
123
This behavior is also consistent with JSON semantics, where object keys may be empty strings.
Expected / Documented Behavior
Based on the current grammar definition using 1*, the empty string "" would not be considered a valid quoted-string, which does not reflect the actual parser behavior.
Suggested Change
To better align the documented grammar with the existing behavior and JSON string semantics, it may be more accurate to define quoted-string as:
quoted-string = quote *(unescaped-char / escaped-char) quote
This allows zero or more characters between the quotes and explicitly includes the empty string "".
Notes
- This issue does not propose any change to parser behavior.
- The suggestion is intended purely as a documentation / grammar clarification to reflect existing, widely implemented behavior.
- Dominant language
- Makefile
- Stars
- 61
- Forks
- 61
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from jmespath/jmespath.site
-
Difficulty 1/5 Under an hour Newbie friendliness 50/100
jmespath/jmespath.site#135 ·
-
認真 Open
Difficulty 5/5 Over a week Newbie friendliness 1/100
jmespath/jmespath.site#129 ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
jmespath/jmespath.site#128 ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
jmespath/jmespath.site#127 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 45/100
jmespath/jmespath.site#126 · 1 reaction ·
All issues in jmespath/jmespath.site
Similar issues
-
user-reported
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Kong/developer.konghq.com#7316 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Ecosystem: ClawMetry — the Qwen Code reader is now free and open source (follow-up to #9294 / #9338) Opencategory/integration priority/P3 scope/documentation status/ready-for-human type/feature-request
Difficulty 1/5 Under an hour Newbie friendliness 84/100