-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature wish: JSONPath #343
Comments
Currently, only JSON Pointer is implemented. JSON Path sounds interesting, but I currently do not have the time to look into it. |
I had another look at this. It seems doable, but also a lot of work. I shall postpone this ticket until after the 3.0.0 release. |
No worries! It'd definitely a lot of work. Really cool of you to look at it tho, open source is awesome :) |
Is there an agreed upon reference for JSON Path? |
I think this is the first - http://goessner.net/articles/JsonPath/ |
This less of a specification, but rather a list of examples. Furthermore:
|
I'm closing this for now in lieu of a proper specification of "JSONPath", see #343 (comment). |
Hi, @nlohmann Would you consider supporting or accepting the PR of JSONPath? |
Why not? Is there a proper specification now? |
It is still not a standard, but we have "conventional" examples: https://github.com/freestrings/jsonpath/wiki/rust-examples Including those implemented by RedisJSON. |
I see. In any case, it would be best to implement this as free functions; that is, not to add any member functions, because the API is already pretty bloated. Do you think this is possible? |
I haven't dig into the code details yet, and I don't quite understand what you mean by But I think as a parsing path, under the premise that JSONPointer is already supported, it would be best if it can be automatically recognized as JSONPath or JSONPointer and successfully access the element. |
I meant I'd rather have something like json authors = json::selector(j, "$.store.book[*].author"); rather than json authors = j.selector("$.store.book[*].author"); |
Oh, I think I agree with you, after all, |
FYI: |
Now up to draft 6, progress tracked at https://datatracker.ietf.org/wg/jsonpath/about/ , standards track document due in November. |
Is the JsonPath feature available now? |
Hi. @nlohmann : Any news on this ? :-) (btw, I just came across this cool jsonpath online evaluator : JSONPath Online Evaluator by Kazuki Hamasaki for those who might be interested) Thank you. |
It's not on my todo list, but merge requests are welcome. |
A simple query() function would be a fantastic addition. Maybe it's totally out of scope for this project, but searching the issues didn't turn up any discussion, so maybe this issue is just a place to say it wont be done :)
Some related refs:
http://goessner.net/articles/JsonPath/
https://chromium.googlesource.com/external/mozc/+/master/src/net/jsonpath.cc
https://www.genivia.com/doc/xml-rpc-json/html/
The text was updated successfully, but these errors were encountered: