Coder Social home page Coder Social logo

jsonpath's Introduction

Java DSL for reading and testing JSON documents.

------------------------------------------
0.9.0                       2013-09-26
------------------------------------------
- OSGI ready
- Bug fixes
- Performance improvements

- select multiple attributes
    List<Map<String, Object>> matches = JsonPath.read(DOCUMENT, "$.store.book[*].['category', 'title']");
    Map<String, Object> match = JsonPath.read(DOCUMENT, "$.store.bicycle['color', 'display-price']");

- Array operations and slicing improved
    String JSON_ARRAY = "[1, 3, 5, 7, 8, 13, 20]";

    //no slicing
    JsonPath.read(JSON_ARRAY, "$[3]")     => 7			

    //no slicing, multi index	
    JsonPath.read(JSON_ARRAY, "$[0,1,2]") => [1,3,5]		

    //from index 0 (inclusive) until index 3 (exclusive)
    JsonPath.read(JSON_ARRAY, "$[:3]")    => [1,3,5]

    //from index 1 (inclusive) until index 5 (exclusive)		
    JsonPath.read(JSON_ARRAY, "$[1:5]")   => [3, 5, 7, 8]	
    JsonPath.read(JSON_ARRAY, "$[1:15]")  => [3, 5, 7, 8, 13, 20]

     //from tail grab 3 
    JsonPath.read(JSON_ARRAY, "$[-3:]")   => [8, 13, 20]	

    //grab no 3 from tail
    JsonPath.read(JSON_ARRAY, "$[3:]")    => 8		
	
    //grab no 3 from tail (same as above)	
    JsonPath.read(JSON_ARRAY, "$[(@.length -3)]") => 		

- improved filter on primitives. Now you can compare with @
    String json = "{\"contents\": [1,2,3]}";
    List<Integer> result = JsonPath.read(json, "$.contents[?(@ == 2)]");



------------------------------------------
0.8.1                           2012-04-16
------------------------------------------
- Fixed issue http://code.google.com/p/json-path/issues/detail?id=11
- HttpProvider SPI
- Improved JavaDoc
- More experimental work on JsonModel


------------------------------------------
0.8.0                           2012-03-08
------------------------------------------
- Fixed issue http://code.google.com/p/json-path/issues/detail?id=8
- Fixed issue http://code.google.com/p/json-path/issues/detail?id=9
- Improved compliance
- Fixed bug with '=' sign when evaluating expressions
- OSGi support added
- Support for custom array filters in JsonPath
- Lots of new features in JsonModel


------------------------------------------
0.5.6                           2012-02-09
------------------------------------------
- Replaced regexp with custom tokenizer
- Removed static declaration of JSON_PARSER
- Introduced SPI for JsonProvider
- Elaborating new concept with JsonModel

------------------------------------------
0.5.5
------------------------------------------
- Improved JSON bracket notation. $['store']['book'][*]['author name']
  properties can also contain '.' eg $['store']['book'][*]['author.name']

------------------------------------------
0.5.4
------------------------------------------
- Replaced com.googlecode.json-simple with net.minidev.json-smart
- Introduced different parse modes, JsonPath.SLACK_MODE and JsonPath.STRICT_MODE (the slack mode lets you use single quotes or even no quotes at all)

------------------------------------------
0.5.3
------------------------------------------
- Major refactoring
- JsonPath does not always produce a List as response

------------------------------------------
0.5.2
------------------------------------------
- Fixed issue that path was never considered definite if containing a ':'
- Bracket notation is now first class citizen $.foo.bar == $.['foo'].['bar']
- Added JsonAsserter.assertNotDefined(String path) to allow checks for negative existence of a path

jsonpath's People

Contributors

alfthomas avatar dvasilen avatar jacksingleton avatar jochenberger avatar johanhaleby avatar kallestenflo avatar koiuo avatar lintonye avatar mattbishop avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.