You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 465bd27
Browse filesBrowse the repository at this point in the historyBrowse files
<li>We do not support arithmetic in filter expression.</li>
1078
1078
<li>We don't allow dotted array indices. An array index must be surrounded by square brackets.</li>
1079
1079
<li>Python JSONPath is strictly read only. There are no update "selectors", but we do provide methods for converting <code>JSONPathMatch</code> instances to <code>JSONPointer</code>s, and a <code>JSONPatch</code> builder API for modifying JSON-like data structures using said pointers.</li>
1080
-
<li>We don't attempt to handle JSON documents without a top-level array or object (or equivalent Python objects).</li>
1081
1080
</ul>
1082
1081
<p>And this is a list of areas where we deviate from <ahref="https://datatracker.ietf.org/doc/html/rfc9535">RFC 9535</a>.</p>
<li>We don't require the recursive descent segment to have a selector. <code>$..</code> is equivalent to <code>$..*</code>.</li>
1088
1087
<li>We support explicit comparisons to <code>undefined</code> as well as implicit existence tests.</li>
1089
1088
<li>Float literals without a fractional digit are OK. <code>1.</code> is equivalent to <code>1.0</code>.</li>
1090
-
<li>We treat literals (such as <code>true</code> and <code>false</code>) as valid "basic" expressions. So <code>$[?true || false]</code> does not raise a syntax error, which is and invalid query according to RFC 9535.</li>
1089
+
<li>We treat literals (such as <code>true</code> and <code>false</code>) as valid "basic" expressions. For example, <code>$[?true || false]</code>, without an existence test or comparison either side of logical <em>or</em>, does not raise a syntax error.</li>
1090
+
<li>By default, <code>and</code> is equivalent to <code>&&</code> and <code>or</code> is equivalent to <code>||</code>.</li>
1091
+
<li><code>none</code> and <code>nil</code> are aliases for <code>null</code>.</li>
1092
+
<li><code>null</code> (and its aliases), <code>true</code> and <code>false</code> can start with an upper or lower case letter.</li>
1091
1093
</ul>
1092
1094
<p>And this is a list of features that are uncommon or unique to Python JSONPath.</p>
1093
1095
<ul>
1094
1096
<li>We support membership operators <code>in</code> and <code>contains</code>, plus list/array literals.</li>
1095
1097
<li><code>|</code> is a union operator, where matches from two or more JSONPaths are combined. This is not part of the Python API, but built-in to the JSONPath syntax.</li>
1096
1098
<li><code>&</code> is an intersection operator, where we exclude matches that don't exist in both left and right paths. This is not part of the Python API, but built-in to the JSONPath syntax.</li>
1097
1099
<li><code>#</code> is the current key/property or index identifier when filtering a mapping or sequence.</li>
1098
-
<li><code>_</code> is a filter context selector. With usage similar to <code>$</code> and <code>@</code>, <code>_</code> exposes arbitrary data from the <code>filter_context</code> argument to <code>findall()</code> and <code>finditer()</code>.</li>
1100
+
<li><code>_</code> is a filter context identifier. With usage similar to <code>$</code> and <code>@</code>, <code>_</code> exposes arbitrary data from the <code>filter_context</code> argument to <code>findall()</code> and <code>finditer()</code>.</li>
1099
1101
<li><code>~</code> is a "keys" or "properties" selector.</li>
1100
1102
<li><code>^</code> is a "fake root" identifier. It is equivalent to <code>$</code>, but wraps the target JSON document in a single-element array, so the root value can be conditionally selected with a filter selector.</li>
1103
+
<li><code>=~</code> is the the regex match operator, matching a value to a JavaScript-style regex literal.</li>
0 commit comments