From 43b0f30cc7e191442b2ad6c95a511a5bc900391a Mon Sep 17 00:00:00 2001 From: Kalle Stenflo Date: Tue, 23 Sep 2014 12:58:03 +0200 Subject: [PATCH] Updated docs. --- README.md | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 62a02acb..71030e06 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Jayway JsonPath (1.0.0) [![Build Status](https://travis-ci.org/jayway/JsonPath.svg?branch=master)](https://travis-ci.org/jayway/JsonPath) -Jayway JsonPath is a Java port of [Stefan Goessner implementation](http://goessner.net/articles/JsonPath/). JsonPath expressions always refer to a JSON structure in the same way as XPath expression are used in combination +Jayway JsonPath is a Java port of [Stefan Goessner JSONPath implementation](http://goessner.net/articles/JsonPath/). 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. @@ -77,7 +77,7 @@ Given the json } ``` -| JSONPath (click it to try it)| Result | +| JsonPath (click link to try)| Result | | :------- | :----- | | $.store.book[*].author| The authors of all books | | $..author | All authors | @@ -96,7 +96,7 @@ Given the json | $..* | Give me every thing | -Reading a document +Reading a Document ------------------ The simplest most straight forward way to use JsonPath is via the static read API. @@ -185,7 +185,7 @@ Predicates ---------- There are three different ways to create filter predicates in JsonPath. -###Inline predicates +###Inline Predicates Inline predicates are the ones defined in the path. @@ -214,7 +214,7 @@ List> books = parse(json).read("$.store.book[?]", cheapFict Notice the placeholder `?` for the filter in the path. When multiple filters are provided they are applied in order where the number of placeholders must match the number of provided filters. You can specify multiple predicate placeholders in one filter operation `[?, ?]`, both predicates must match. -###Roll your own +###Roll Your Own Third option is to implement your own predicates @@ -229,9 +229,9 @@ Predicate booksWithISBN = new Predicate() { List> books = reader.read("$.store.book[?].isbn", List.class, booksWithISBN); ``` -PATH vs VALUE +Path vs Value ------------- -As specified in the Goessner implementation a JsonPath can return either `Path` or `Value`. `Value` is the default and what all the exaples above are reuturning. If you rather have the path of the elements our query is hitting this can be acheived with an option. +In the Goessner implementation a JsonPath can return either `Path` or `Value`. `Value` is the default and what all the exaples above are reuturning. If you rather have the path of the elements our query is hitting this can be acheived with an option. ```java Configuration conf = Configuration.builder().options(Option.AS_PATH_LIST).build(); @@ -351,10 +351,8 @@ JsonPath is available at the Central Maven Repository. Maven users add this to y 0.9.1 ``` - Gradle users - ``` compile 'com.jayway.jsonpath:json-path:0.9.1' ```