Return-Path: <wwwrun@rfcpa.rfc-editor.org>
X-Original-To: jsonpath@ietf.org
Delivered-To: jsonpath@mail2.ietf.org
Received: from rfcpa.rfc-editor.org (unknown [167.172.21.234])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256)
	(No client certificate requested)
	by mail2.ietf.org (Postfix) with ESMTPS id 11A7A1364C38;
	Thu, 27 Mar 2025 11:30:23 -0700 (PDT)
Received: by rfcpa.rfc-editor.org (Postfix, from userid 461)
	id BF3B6239664; Thu, 27 Mar 2025 11:30:22 -0700 (PDT)
To: vladimir.gorej@gmail.com, stefan.goessner@fh-dortmund.de,
 glyn.normington@gmail.com, cabo@tzi.org
From: RFC Errata System <rfc-editor@rfc-editor.org>
Content-Type: text/plain; charset=UTF-8
Message-Id: <20250327183022.BF3B6239664@rfcpa.rfc-editor.org>
Date: Thu, 27 Mar 2025 11:30:22 -0700 (PDT)
Message-ID-Hash: RLZDQU6RNEXEI76GBM6RQIKEWPWPW4FZ
X-Message-ID-Hash: RLZDQU6RNEXEI76GBM6RQIKEWPWPW4FZ
X-MailFrom: wwwrun@rfcpa.rfc-editor.org
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency;
 loop; banned-address; member-moderation; nonmember-moderation; administrivia;
 implicit-dest; max-recipients; max-size; news-moderation; no-subject;
 digests; suspicious-header
CC: andy@hxr.us, iesg@ietf.org, jsonpath@ietf.org, iana@iana.org,
 rfc-editor@rfc-editor.org
X-Mailman-Version: 3.3.9rc6
Precedence: list
Subject: =?utf-8?q?=5BJsonpath=5D_=5BErrata_Verified=5D_RFC9535_=288343=29?=
List-Id: Discussion of JSONPath syntax <jsonpath.ietf.org>
Archived-At: 
 <https://mailarchive.ietf.org/arch/msg/jsonpath/PRPGXRsMCoI6z3X8csUzMKP2ZHA>
List-Archive: <https://mailarchive.ietf.org/arch/browse/jsonpath>
List-Help: <mailto:jsonpath-request@ietf.org?subject=help>
List-Owner: <mailto:jsonpath-owner@ietf.org>
List-Post: <mailto:jsonpath@ietf.org>
List-Subscribe: <mailto:jsonpath-join@ietf.org>
List-Unsubscribe: <mailto:jsonpath-leave@ietf.org>

The following errata report has been verified for RFC9535,
"JSONPath: Query Expressions for JSON". 

--------------------------------------
You may review the report below and at:
https://www.rfc-editor.org/errata/eid8343

--------------------------------------
Status: Verified
Type: Technical

Reported by: Vladimír Gorej <vladimir.gorej@gmail.com>
Date Reported: 2025-03-24
Verified by: Andy Newton (IESG)

Section: 2.4

Original Text
-------------
function-argument   = literal /
                      filter-query / ; (includes singular-query)
                      logical-expr /
                      function-expr

Corrected Text
--------------
function-argument   = logical-expr /
                      filter-query / ; (includes singular-query)
                      function-expr /
                      literal

Notes
-----
The ABNF grammars in RFC 9535 were designed to be directly usable with PEG (Parsing Expression Grammar) parsers.

However, PEG parsers will fail to parse $[?blt(1==1)] or $[?true(1)==0] with the grammar as given, as they employ prioritized choice, where the order matters.

In the order given, they will try to match the `literal` rule in `function-argument` with the input `1==1`, and find that the `1` indeed matches a `number`, completing the match for `function-argument` and preempting the other choices.  The intended rest of the `function-argument`, `==1` does not match anything, and the rule fails.
By putting the more complex `logical-expr` first, the whole `1==1` matches, and the rule succeeds as intended.

Similary, the function name `true` matches as the literal `true` instead, and preempts parsing `true(1)` as the more complex `function-expr`.  Putting the `literal` choice last prevents the preemptive match.


--------------------------------------
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

