symfony/json-path
Symfony JsonPath is a PHP component for navigating and querying JSON using JSONPath syntax per RFC 9535. Use JsonCrawler to evaluate paths, filter expressions, and extract values from complex JSON documents.
isset() checks.$.user.email).GET /api/reports?path=$.metrics[*].value).key() escaping of backslashes and control characters, and to anchoring/slash escaping in match()/search() — meaning path expressions that previously misbehaved now resolve correctly, which broadens the set of safe query patterns (keys containing special characters, anchored regex filters).null array elements — a data-integrity bug with real product impact: pipelines that count, index, or iterate array results could silently lose null entries. If any roadmap items depend on positional array semantics (e.g., "position N in a list", pagination offsets, aligned metrics arrays), that dependency is now safer.null array elements in index and slice selectors, so pin the patched version or later.$.sum()). Consider jsonpath-plus or spatie/array-to-xml for advanced use cases.json_decode() + manual loops for simple paths.jsonpath for Python, jsonpath for JavaScript).jsonpath_query) may be better.spatie/laravel-json or write custom logic.null values — treat that as a correctness blocker until upgraded, or stay with manual traversal for those paths.Executives:
"This package lets us query JSON data like a database—no more writing brittle nested if statements or manual loops to extract fields from API responses. For example, instead of hardcoding json_decode($response)['user']['profile']['name'], we’ll use JsonPath::search($response, '$.user.profile.name'). This cuts development time by 30–50% for JSON-heavy features, reduces bugs in parsing logic, and makes our APIs more maintainable. It’s a drop-in solution with zero operational overhead. The latest release (v8.1.9) is a maintenance patch that fixes three correctness bugs—special-character escaping in keys, filtering/anchoring edge cases, and a bug that could silently drop null entries from array results—with no breaking changes. That last fix matters because it protects our data pipelines from quietly losing records; upgrading is a low-risk, high-value hygiene step, not a re-platforming decision."
Engineering (Devs/Architects): *"Symfony’s JSONPath implementation is RFC 9535 compliant, battle-tested, and integrates seamlessly with Laravel. Key benefits:
isset() checks with a single JsonPath::evaluate() call.// Before (brittle)
$user = json_decode($response)->user->profile->name;
// After (declarative)
$user = JsonPath::search($response, '$.user.profile.name');
Engineering (v8.1.9 release note to forward to the team): *"Patch release — bug fixes only, no API changes:
JsonPath::key() now escapes backslashes and control characters correctly, so keys containing \, newlines, or other control chars are addressable.match() / search() anchoring and slash escaping fixed — regex filters with anchors or escaped slashes now behave as specified.null array elements — previously, $[0] or $[1:3] could shift or lose results when the array contained null. If any pipeline counts or indexes array results, this is a silent data-loss bug; upgrade and add a regression test asserting null entries survive slicing.
Action: bump to ^8.1.9, run the existing path-expression test suite, and spot-check any code that slices arrays or filters on regexes."*Data/Analytics Teams:
"This enables self-service JSON querying for reports and dashboards. For example, instead of writing custom scripts to extract $.metrics[*].value, analysts can use JSONPath directly in our internal tools. It also simplifies ETL pipelines by standardizing how we extract data from JSON sources. One caveat worth knowing: versions before 8.1.9 could silently drop null values when slicing arrays, which is exactly the kind of thing that skews a report without erroring. The fix is already in; we just need to confirm our extraction jobs run on the updated version and that any array-position assumptions are re-validated."
How can I help you explore Laravel packages today?