From 79fe5d21920f784edd663dbf71d0272bc0eb3cd1 Mon Sep 17 00:00:00 2001 From: Henry Andrews Date: Fri, 15 May 2020 12:27:10 -0700 Subject: [PATCH] Rel JSON Ptr forward/backward index manipulation This allows using a relative pointer to look ahead or behind in arrays when calculating the initial point at which to apply the JSON Pointer that is the suffix of the Relative JSON Pointer. --- relative-json-pointer.xml | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/relative-json-pointer.xml b/relative-json-pointer.xml index b39faa0a..06af623c 100644 --- a/relative-json-pointer.xml +++ b/relative-json-pointer.xml @@ -33,7 +33,7 @@ - + Internet Engineering Task Force JSON JavaScript @@ -134,6 +134,24 @@ + + If the next character is a plus ("+") or minus ("-"), followed by another + continuous sequence of decimal digits, the following steps + are taken using the decimal numeric value of that plus or minus sign + and decimal sequence: + + + If the current referenced value is not an item of an array, + then evaluation fails (see below). + + + If the referenced value is an item of an array, then the + new referenced value is the item of the array indexed by + adding the decimal value (which may be negative), to the + index of the current referenced value. + + + If the remainder of the Relative JSON Pointer is a JSON Pointer, then evaluation proceeds as per @@ -300,6 +318,11 @@ + + + Add array forward and backward index manipulation + + Update to the latest JSON RFC