Skip to content

Releases: jg-rp/json-p3

Version 1.3.4

05 Aug 07:08
Compare
Choose a tag to compare

Fixes

  • Fixed decoding of JSONPath escape sequences (those found in name selectors and string literals). Previously we were relying on JSON.parse() to unescape strings, now we have our own unescapeString() function that rejects invalid code points and surrogate pairs. See jsonpath-compliance-test-suite #87.
  • Fixed default minimum integer boundary for JSONPath indexes and slice steps. We were off by one.
  • Fixed parsing of JSONPath integer literals with an exponent and an upper case 'e'. We now allow 'e' to be upper case.
  • Fixed handling of trailing commas in JSONPath bracketed segments. We now raise a syntax error.
  • Fixed handling of invalid JSONPath integer and float literals with extra minus signs, leading zeros or too many zeros. We now raise a syntax error in such cases.

Version 1.3.3

21 May 06:46
Compare
Choose a tag to compare

Fixes

  • Fixed handling of JSONPath filter expression literals. We now throw a JSONPathSyntaxError if a filter expression contains a literal (string, int, float, boolean, null) that is not part of a comparison or function expression. See jsonpath-compliance-test-suite #81.

Version 1.3.2

16 May 06:08
Compare
Choose a tag to compare

Fixes

  • Fixed more I-Regexp to RegExp pattern mapping. See jsonpath-compliance-test-suite#77.
  • We now check that regular expression patterns passed to match and search are valid according to RFC 9485. The standard behavior is to silently return false from these filter function if the pattern is invalid. The throwErrors option can be passed to Match and/or Search to throw an error instead, and the iRegexpCheck option can be set to false to disable I-Regexp checks.

Version 1.3.1

09 May 17:35
Compare
Choose a tag to compare

Fixes

  • Fixed RegExp to I-Regex pattern mapping with the match and search filter functions. We now correctly match the special . character to everything other than \r and \n.

Version 1.3.0

03 May 12:40
Compare
Choose a tag to compare

Fixes

  • Fixed the normalized path for nodes created by the non-standard keys selector. Previously, the normalized path of a node produced from a keys selector would always result in an empty node list, now it uses key selector syntax. Note that this fix only applies when the default key token (~) is used. Custom key tokens are problematic when it comes to other, co-operating key selectors. If you're only interested in values from a node list, this wont affect you.

Features

  • Added the non-standard key selector (docs).
  • Added the non-standard keys filter selector (docs).

Version 1.2.1

27 Apr 07:42
Compare
Choose a tag to compare

Fixes

  • Fixed JSONPath name selectors that operator on array values. Previously, if a name selector were a quoted digit, we would treat that digit as an array index. The name selector now selects nothing if the target value is an array.
  • Fixed the lazy JSONPath slice selector. Previously, the lazy slice selector was not slicing values lazily, but creating an intermediate array.
  • Fixed JSONPath syntax error messages resulting from unbalanced parentheses or empty paren expressions.

Version 1.2.0

26 Mar 07:28
Compare
Choose a tag to compare

Fixes

  • Fixed the error and error message arising from JSONPath queries with filter expressions and a missing closing bracket for the segment. Previously we would get a JSONPathLexerError, stating we "can't backup beyond start", which is meant to be an internal error. We now get a JSONPathSyntaxError with the message "unclosed bracketed selection".

Features

  • Added a non-standard keys selector (~), selecting property names from objects. The keys selector is only enabled when setting JSONPathEnvironment's strict option to false (docs, source).
  • Added a non-standard current key identifier (#). # will be the key or index corresponding to @ in a filter expression. The current key identifier is only enabled when setting JSONPathEnvironment's strict option to false (docs, source).

Version 1.1.1

12 Mar 07:21
Compare
Choose a tag to compare

Fixes

  • Fixed evaluation of JSONPath singular queries when they appear in a logical expression and without a comparison operator. Previously we were evaluating logical expressions with the value held by the single element node list, now we treat such filter queries as existence tests.

Version 1.1.0

07 Mar 08:19
Compare
Choose a tag to compare

Fixes

  • Fixed logical operator precedence in JSONPath filter expressions. Previously, logical or (||) had a higher precedence than logical and (&&). Now && binds more tightly than ||.

Features

  • Added nondeterministic to JSONPathEnvironmentOptions and environment variables to control nondeterminism and the location of cts.json when testing for compliance. See the README for a description of these environment variables.

Version 1.0.0

23 Feb 14:47
Compare
Choose a tag to compare

RFC 9535 has been published, replacing the draft IETF JSONPath base.