+0
Daily
9,456
stars
1,715
forks
278
watchers
412
prs
675
issues
12
releases
README
Jayway JsonPath
=====================
A Java DSL for reading JSON documents.
Jayway JsonPath is a Java port of Stefan Goessner JsonPath implementation.
Getting Started
---------------
JsonPath is available at the Central Maven Repository. Maven users add this to your POM.
[!NOTE]
Version 3.0.0 Uses Java 17 baseline to support Jackson 3
xml
com.jayway.jsonpath
json-path
3.0.0
If you need help ask questions at Stack Overflow. Tag the
question 'jsonpath' and 'java'.
JsonPath expressions always refer to a JSON structure in the same way as XPath expression are used in combination
with an XML document. The "root member object" in JsonPath is always referred to as $ regardless if it is an
object or array.
JsonPath expressions can use the dot–notation
$.store.book[0].title
or the bracket–notation
$['store']['book'][0]['title']
Operators
---------
| Operator | Description |
|:--------------------------|:----------------------------------------------------------------|
| $ | The root element to query. This starts all path expressions. |
| @ | The current node being processed by a filter predicate. |
| | Wildcard. Available anywhere a name or numeric are required. |
| .. | Deep scan. Available anywhere a name is required. |
| . | Dot-notated child |
| ['' (, '')] | Bracket-notated child or children |
| [ (, )] | Array index or indexes |
| [start:end] | Array slice operator |
| [?()] | Filter expression. Expression must evaluate to a boolean value. |
Functions
---------
Functions can be invoked at the tail end of a path - the input to a function is the output of the path expression.
The function output is dictated by the function itself.
| Function | Description | Output type |
|:------------|:-------------------------------------------------------------------------------------|:---------------------|
| min() | Provides the min value of an array of numbers | Double |
| max() | Provides the max value of an array of numbers | Double |
| avg() | Provides the average value of an array of numbers | Double |
| stddev() | Provides the standard deviation value of an array of numbers | Double |
| length() | Provides the length of an array | Integer |
| sum() | Provides the sum value of an array of Top issues
#272Filter expression return array can not use [index] get item inside 39 comments · 2016-10-18#287Filter on children level, return the parent node38 comments · 2016-12-05#425Check if the Path Exists 14 comments · 2018-01-10#83Creation of deep nodes14 comments · 2015-04-28#191Aggregation function attempted to calculate value using empty array13 comments · 2016-02-16#105Make use of JSR 353 (JSON Processing) API12 comments · 2015-07-15#975concurrency issue / race condition11 comments · 2023-12-21#886https://jsonpath.herokuapp.com/11 comments · 2023-01-26
Latest release
json-path-3.0.0 json-path-3.0.0 2026-02-22What's Changed adding jackson3 provider (1066) by @bsa01 in https://github.com/json-path/JsonPath/pull/1067 Prepare Version 3.0.0 - Java 17 baseline with Jackson 3 by @kallestenflo in https://github.com/json-path/JsonPath/pull/1072 New Contributors @bsa01 made their first contribution in https://github.com/json-path/JsonPath/pull/1067 Full Changelog: https://github.com/json-path/JsonPath/compare/json-path-2.10.0...json-path-3.0.0