Releases: SoftCreatR/JSONPath
Releases · SoftCreatR/JSONPath
Release list
2.1.0
- Added the RFC 9535
length(),count(),match(),search(), andvalue()function extensions. - Added a dedicated expression parser and static type checker for function expressions; malformed and ill-typed expressions are rejected without evaluating user-controlled PHP code.
- Added checked RFC 9485 I-Regexp support for full-string and substring matching, with PCRE resource limits.
2.0.0
🔻 Breaking changes ahead:
- Aligned every current result with the JSONPath comparison consensus or majority.
- Tightened selector parsing so malformed or ambiguous syntax is rejected instead of being interpreted as another query. This removes unquoted bracket members, quoted dot members, empty selectors, incomplete recursive descent, script expressions, mixed wildcard/filter unions, and synthetic
.lengthhandling. - Restricted filter operators to portable comparisons (
==,!=,<,<=,>,>=) and logical expressions; legacy single/strict equality, regex, membership, arithmetic, literal-only truth tests, array/object comparison literals, and function-like expressions are now unsupported. - Fixed filters over objects to return node lists, added descendant and nested-filter existence tests, distinguished missing nodes from JSON
null, and corrected missing-member/path-to-path comparisons. - Lowered the minimum PHP version from 8.5 to the verified PHP 8.3 floor and expanded CI to PHP 8.3 through 8.6, including the PHP 8.6 nightly.
- Kept the PHPUnit suite at 100% class, method, and line coverage for the stricter behavior.
1.0.2
Fixed tokenizer handling for quoted bracket keys containing $ so literals like ['[$the.size$]'] remain atomic and do not split into root tokens.
Full Changelog: 1.0.1...1.0.2
1.0.1
- Aligned the query runner and lexer with the JSONPath comparison suite: JSON documents are now decoded as objects to preserve
{}vs[], unsupported selectors no longer abort the runner, and dot-notation now accepts quoted keys with dots/spaces/leading@. - Hardened filter parsing: boolean-only filters (
?(true|false|null)), literal short-circuiting (&& false,|| true), and empty filters now return the expected collections instead of throwing. - Slice filters gracefully skip non-countable objects.
Full Changelog: 1.0.0...1.0.1
1.0.0
Version 1.0.0 is finally here!
- Rebuilt the test suite from scratch: removed bulky baseline fixtures and added compact unit/integration coverage for every filter (index, union, query, recursive, slice), lexer edge cases, and JSONPath core helpers. Runs reflection-free and deprecation-free.
- Achieved and enforced 100% code coverage across AccessHelper, all filters, lexer, tokens, and JSONPath core while keeping phpstan and coding standards clean.
- Added a lightweight manual query runner with curated examples to exercise selectors quickly without external datasets.
- Major compatibility push toward the unofficial JSONPath standard: unions support slices/queries/wildcards, trailing commas parse correctly, negative indexes and bracket-escaped keys (quotes, brackets, wildcards, special chars) are honored, filters compare path-to-path and root references, equality/deep-equality/regex/in/nin semantics align with expectations, and null existence/value handling follows RFC behavior.
- New feature highlights from this cycle:
- Multi-key unions with and without quotes:
$[name,year]and$["name","year"]. - Robust bracket notation for special/escaped keys, including
']','*',$, backslashes, and mixed punctuation. - Trailing comma support in unions/slices (e.g.
$..books[0,1,2,]). - Negative index handling aligned with spec (short arrays return empty; -1 works where valid).
- Filter improvements: path-to-path/root comparisons, deep equality across scalars/objects/arrays/null/empties, regex matching,
in/nin/!in, tautological expressions, and?@existence behavior per RFC. - Unions combining slices/queries/wildcards now return complete results (e.g.
$[1:3,4],$[*,1]).
- Multi-key unions with and without quotes:
Full Changelog: 0.11.0...1.0.0
0.11.0
🔻 Breaking changes ahead:
- Dropped support for PHP < 8.5
JSONPathTokennow uses aTokenTypeenum and the constructor signature changed accordingly.JSONPathoptions flag is now anintbitmask (wasbool), requiring callers to pass integer flags.SliceFilterreturns an empty result for non-positive step values (previously iterated indefinitely).QueryResultFilternow throws aJSONPathExceptionfor unsupported operators instead of silently proceeding.- Access helper behavior is stricter:
arrayValuesthrows on invalid types; ArrayAccess lookups checkoffsetExistsbefore reading; traversables and objects are handled distinctly. - Adopted PHP 8.5 features:
TokenTypeenum, readonly value object for tokens, typed flags/options, and#[\Override]usage. - CI now runs on PHP 8.5 with required extensions; code style workflow updated accordingly.
- Added coverage for AccessHelper edge cases (magic getters, ArrayAccess, traversables, negative indexes), QueryResultFilter arithmetic branches, and SliceFilter negative/null bounds.
- Fixed empty-expression handling in lexer and improved safety in AccessHelper traversable lookups.
- Added PHPStan static analysis to the toolchain and addressed its findings.
Full Changelog: 0.10.0...0.11.0
0.10.0
What's Changed
- Refactoring of QueryMatchFilter and provide greater support for JSONPath spec by @lucasnetau in #79
New Contributors
- @lucasnetau made their first contribution in #79
Full Changelog: 0.9.1...0.10.0