Closed springcomp closed 1 year ago
Sorry I missed this PR a couple weeks ago, but that JSON RFC erratum has not been verified and basically cannot be accepted because JSON is synchronized between the IETF and ECMA... U+002F solidus "/" is allowed inside JSON strings both unescaped and preceded by an escaping backslash.
But in JMESPath, the unescaped-char
nonterminal is primarily for identifier
via quoted-string
and shouldn't even relate to JSON text at all.
@gibson042 I trust you that the JSON errata has not been verified, and I agree that solidus should be valid escaped or non-escaped. I will revert this change.
However, the quoted-string
rule from JMESPath is shared between identifier
and json-value
.
JSON and JMESPath do have some relation at least.
But reverting the PR should be sufficient I reckon.
However, the
quoted-string
rule from JMESPath is shared betweenidentifier
andjson-value
. JSON and JMESPath do have some relation at least.
Right, and that strikes me as a problem... the keys for JSON object members must be JSON strings, but right now JMESPath inconsistently has both json-value = false / null / true / json-object / json-array / json-number / json-quoted-string
(where json-quoted-string
introduces a \`
escape and disallows unescaped `
) and member = quoted-string name-separator json-value
(where quoted-string
allows unescaped `
and does not have a \`
escape), which doesn't make any sense.
I think you are right. Would that be a simple oversight that could be fixed with?
member = json-quoted-string name-separator json-value
Yes, I think so.
The JMESPath grammar mostly includes rules for parsing valid JSON texts. However, the JSON RFC includes errata that were not included in this spec.
In particular, the two
unescaped-char
andescaped-char
rules are inconsistent:The
/
U+002F SOLIDUS character is present in those two rules. It should, however, be excluded from theunsecaped-char
rule.This PR fixes this issue.