jsonpath
12 posts tagged jsonpath, newest first.
Posts
Escapes refused or read in halves: quoted strings in OjG
OjG, a Go library for JSON, refused \/ in a quoted name and read an escaped UTF-16 pair as two U+FFFD. RFC 9535 section 2.3.1.1 allows both.
A not that read to the end of the filter: the ! operator in OjG
In OjG, a Go JSON library with JSONPath, ! in a filter took in every && and || term after it: !@.a && @.b meant !(@.a && @.b). (!@.a) && @.b already worked.
A minus sign read as part of the operator: negative numbers in OjG filters
jp.ParseString in OjG, a Go JSON library with JSONPath, rejected a filter with no space between an operator and a negative number, such as $[?@.a==-1].
Anchors that split at an alternation: match() in OjG
In the Go library OjG, a JSONPath match() pattern with a top-level | was not tested against the whole string: ab|cd also matched abx and xcd, though RFC 9535 section…
Bytes counted instead of characters: length() of a string in OjG
length() of a string in OjG, a Go JSON library with JSONPath, returned the number of bytes, so "жж" had a length of 4.
Equal operands that never satisfied <= or >=: filter comparisons in OjG
In OjG, a Go JSON library with JSONPath, <= and >= in a filter never matched two equal null, boolean, array or object values, or two missing values. == did.
An empty pattern that matched nothing: match() and search() in OjG
An empty pattern, '', made match() and search() select nothing in OjG, a Go library for JSON.
A dot that matched a carriage return: match() and search() in OjG
match(@, '.') and search(@, '.') selected a string that was one carriage return in OjG, a Go JSON library.
A tab, line feed or carriage return refused as blank space: JSONPath queries in OjG
A JSONPath filter written over two lines did not parse in OjG, a Go library for JSON.
Blank space refused before a segment and in a slice: JSONPath parsing in OjG
$ .a and $[1:5 :2] were parse errors in OjG, a Go library for JSON, though RFC 9535 allows blank space before a path segment and between the parts of a slice.
A group that dropped the existence check: parenthesized paths in OjG
In OjG, a Go JSON library with JSONPath, a bare @.x in a filter tests that x exists, but (@.x) beside &&, || or ! did not.
Go's == where value equality belongs: the in filter in OjG
The in filter in OjG, a Go JSON library with JSONPath, panicked when its left operand was an array or object and the list held a member of the same kind.