- The recursive operation now works slightly different (see https://github.com/Galbar/JsonPath-PHP/commit/5ac1783ed447063357f472a080d56dbdfe5b4ee8)
- Queries with no matches will now return empty arrays, instead of
false
. The only exception being when using smart get and a non-divergent path, wherefalse
will still be returned.
- Support for child selector operation immediatly after recursive operation:
$..[?(@.author == "Nigel Rees")]
- In|Not In Array Operation (#65 by @lucasangi)
- Added formal support for variable names starting with numbers in the dot-notation:
$.2
- Allow filter keys with a regex match (#59)
- Allow PCRE
i
andx
modifiers in regex expressions (#59) - Fix bug causing a DivisionByZeroError when using negative indexes to access an empty array (#60)
Until now (except for version 1.3, sorry, you should go to 1.3.1 if this affects you) .length operator always behaved in the smartGet manner.
Starting with this version, .length will behave as any other operator. That is, it will always return an array of results, even if there is just one, unless smartGet is enabled, then it'll work in the same way smartGet works for every other operation: return the result directly, if the path does not diverge, or return an array of results, if the path diverges.
Also, fix regex so that array interval selector of the type [:3]
work.
- Revert .length behavior to avoid breaking changes in same major version
- Expose internal language parsing and querying functions as part of the public API
- Add
!
as synonym ofnot
- Add
&&
as synonym ofand
- Add
||
as synonym ofor
- Drop support for PHP 5.4 and 5.5
- Add support for PHP 7.2 and 7.3
- Add utf-8 support (#33)
- Ability to use .length outside of [] (#28)
- Drop support for PHP 5.3
- Adding json_encode options bitmask (#7)
- Allows minus character within property name (by jaimelopez)
- Bug fix in
.length
regex. - Minor code cleanup.
- Documentation now properly defines what a variable name is.
- Dependencies are now properly defined for older PHP versions.
- Bug fix when accessing an array with a negative index. It now behaves as expected.
- set now creates non-existent intermediate objects. (p.e. if quering '$.a' results in false, when setting '$.a.b' to a value '$.a' will be created as a result of this).
- Added custom Exception classes:
InvalidJsonException
is thrown when an invalid values is given to the JsonObject constructor.InvalidJsonPathException
is thrown when an invalid JSONPath is given.
- Added getJsonObjects to get child JsonObjects that reference the original JsonObject contents. This is also affected by smartGet.
- Added support for json objects with fields with names that are not valid javascript variable names.
- Fixed error in smart get when accessing a list of names or list of indices and only one existed in the object.
- Added smart get
- Added errors when invalid json type is passed to construct
- Efficiency improvements
- All tokens are constants
- Basic JsonPath functionality