From c6423d804504e0325fd3ecd6ea8027fcbae6ab9c Mon Sep 17 00:00:00 2001 From: Davide Bettio Date: Fri, 19 Mar 2021 13:10:47 +0100 Subject: [PATCH] WIP: allow starting with @ --- draft-ietf-jsonpath-base.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/draft-ietf-jsonpath-base.md b/draft-ietf-jsonpath-base.md index fdae1be1..9a148950 100644 --- a/draft-ietf-jsonpath-base.md +++ b/draft-ietf-jsonpath-base.md @@ -449,13 +449,15 @@ return an error. ## Syntax -Syntactically, a JSONPath consists of a root selector (`$`), which -selects the root node of a JSON value, followed by a possibly empty -sequence of *selectors*. +Syntactically, a JSONPath consists of either a root selector (`$`), which +selects the root node of a JSON value, or a current item selector (`@`), +followed by a possibly empty sequence of *selectors*. ~~~~ abnf -json-path = root-selector *selector +json-path = start-selector *selector +start-selector = root-selector / current-item-selector root-selector = "$" ; $ selects document root node +current-item-selector = "@" ; @ selects current node ~~~~ The syntax and semantics of each selector is defined below.