Comments (6)
Which JsonPath spec? Can you provide a sample json and the expected result of your example?
from jsonsurfer.
http://goessner.net/articles/JsonPath/
"Script expression evaluated by the underlying script engine"
For example the jayway implementation allows some functions, min, max, etc.
https://github.com/json-path/JsonPath#functions
Ideally this would need to be an addition to the antlr grammar to allow pluggable functions that could be defined in the JsonSurfer instance
from jsonsurfer.
{
"items": [1,2,3,-1]
}
$.items.size() // 4
$.items.min() // -1
$.items.toString() // "[1,2,3,-1]"
from jsonsurfer.
I think it would not be too difficult if the "functions" apply only to leaf level(as the last node), then the implementation should be similar to JsonPath filter. Any pull requests for this feature are welcome. I'd love to help, if you have any further question.
from jsonsurfer.
Alternatively, you can use stream API of Java8 to achieve above "functions". Please refer to https://github.com/jsurfer/JsonSurfer#stream-support
from jsonsurfer.
Examples added in document:
https://github.com/jsurfer/JsonSurfer#java-8-streams-api-support
from jsonsurfer.
Related Issues (20)
- Property binding not working when it's coupled with a filtered binding HOT 6
- Results do not match other implementations HOT 5
- JSON transformation HOT 1
- JSONPath comparison and standardisation
- Filter does not apply to object fields when wildcard used HOT 2
- Filter does not support object fields starting with @ HOT 4
- Add benchmarks using streaming parser HOT 2
- Support closing of underlying parser (important performance aspect for Jackson backend) automatically or explicitly HOT 14
- Add ability to parse 'live' JSON files HOT 2
- JsonPath/SQL standard HOT 1
- The underlying Jackson parser doesn't support BigInteger HOT 4
- Could CollectOneListner be made public now collectOne is deprecated? No simple replacement exists? HOT 4
- Improve filtering on objects (argument matching nested object) HOT 6
- Create JPATH Compare using not equals (!=)
- Gson before 2.8.9 are vulnerable HOT 1
- Support for feeding via bytebuffers HOT 2
- Is it possible to make multiple queries in one jsonPath? HOT 1
- Dependency com.alibaba:fastjson, leading to CVE problem
- Problems using JsonSurfer in projects using a different version of ANTLR HOT 1
- Support for modifying values during non blocking streaming
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jsonsurfer.