Subject: [Jsonpath] Re: [Technical Errata Reported] RFC9535 (8343)
From: "Andrew Newton (andy)" <[email-masked]>
To: Glyn Normington <[email-masked]>, RFC Errata System <[email-masked]>
Cc: [email-masked], [email-masked], [email-masked], [email-masked], [email-masked], [email-masked], [email-masked], [email-masked]
Date: Mon, 24 Mar 2025 15:09:25 -0400
List-Id: Discussion of JSONPath syntax <jsonpath.ietf.org>

Hi Glyn,

The guidelines for the processing of errata can be found here: https://datatracker.ietf.org/doc/statement-iesg-iesg-processing-of-rfc-errata-for-the-ietf-stream-20210507/

Unless this was a mistake when the document was published, IMO the status for this errata cannot be "verified". While I sympathize with the issue (having used PEG parsers myself and run into these issues), it is difficult to see how this ordering was originally in error.

I think this should be categorized as "Hold for Document Update", but I am curious what others think.

-andy, ART AD

On 3/24/25 14:57, Glyn Normington wrote:
> I think this erratum should be verified. (Furthermore, the correction looks sound to me.)
>
> Regards,
> Glyn
>
> On Mon, 24 Mar 2025 at 16:54, RFC Errata System <[email-masked]> wrote:
>
>     The following errata report has been submitted for RFC9535,
>     "JSONPath: Query Expressions for JSON".
>
>     --------------------------------------
>     You may review the report below and at:
>     https://www.rfc-editor.org/errata/eid8343
>
>     --------------------------------------
>     Type: Technical
>     Reported by: Vladimír Gorej <[email-masked]>
>
>     Section: 2.4
>
>     Original Text
>     -------------
>     function-argument   = literal /
>                           filter-query / ; (includes singular-query)
>                           logical-expr /
>                           function-expr
>
>     Corrected Text
>     --------------
>     function-argument   = logical-expr /
>                           function-expr /
>                           filter-query / ; (includes singular-query)
>                           literal
>
>
>     Notes
>     -----
>     PEG (Parsing Expression Grammar) parsers will fail to parse $[?blt(1==1)] with the RFC 9535 ABNF grammar.
>     PEG parsers use ordered choice, so by implication the order matters a lot.
>
>     PEG tries to match `literal` production rule with input `1==1`
>     - 1 matches a `number`
>     - But == breaks the rest of the rule
>     - But because `number` is a subrule of `literal`, and `literal` matches partially (just the 1)…
>     - PEG commits to `literal` and doesn't try `logical-expr`
>
>     Thus: `function-argument` fails, even though `logical-expr` would have matched.
>
>     Why the "Corrected Text" will work with PEG parsers and is PEG-safe? It includes the most complex structures first and prevents early partial matches.
>
>     PS: also the https://www.rfc-editor.org/rfc/rfc9535#appendix-A is affected
>
>     Instructions:
>     -------------
>     This erratum is currently posted as "Reported". (If it is spam, it
>     will be removed shortly by the RFC Production Center.) Please
>     use "Reply All" to discuss whether it should be verified or
>     rejected. When a decision is reached, the verifying party
>     will log in to change the status and edit the report, if necessary.
>
>     --------------------------------------
>     RFC9535 (draft-ietf-jsonpath-base-21)
>     --------------------------------------
>     Title               : JSONPath: Query Expressions for JSON
>     Publication Date    : February 2024
>     Author(s)           : S. Gössner, Ed., G. Normington, Ed., C. Bormann, Ed.
>     Category            : PROPOSED STANDARD
>     Source              : JSON Path
>     Stream              : IETF
>     Verifying Party     : IESG
>
>     -- 
>     JSONpath mailing list -- [email-masked]
>     To unsubscribe send an email to [email-masked]
>