'path' feature #42
wimjongman
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
|
I agree something like this is needed, but I'd prefer to have following the JSON Path standard (see https://en.wikipedia.org/wiki/JSONPath). There is an implementation of that in the mjson-ext project (see https://github.com/bolerio/mjson-ext/tree/master/jsonpath), but it has a 3d party dependency which is a bit counter to the mjson minimalistic philosophy. If we have a JSON Path implementation with no extra dependencies, we could somehow include in the mjson API, either within the or as a separate |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have added a method to get the last entry of a path. Let me know if this is useful and I will create a PR.
Usage
Json name = json.path("info", "title", "contact", "name");Advantage
With this feature we can traverse down a path without having to worry about NPE's
Beta Was this translation helpful? Give feedback.
All reactions