-
-
Notifications
You must be signed in to change notification settings - Fork 819
Closed
Milestone
Description
When working heavily with JsonPointers, the following patterns usually emerges:
JsonPointer root = JsonPointer.compile("/a/b");
/// ... code
String property = "c"
root.append(JsonPointer.compile("/" + property));
/// or
JsonPointer.compile(root + "/" + property)
This is quite verbose, also a bit error prone, because it is easy to forget to add the /
before each append.
Also, I found no easy way of appending slash characters without prior escaping.
So the two methods proposed should help with both convenience and some edge cases. The only thing that worries me is overusing/misusing this methods. Jackson JsonPointer is head centric
, appending to the tail is expensive, so maybe documenting a warning should be good?
I will open a PR when I get some free time. I did a similar thing in the past, so I think I can probably reuse the tests from there.
cowtowncoder
Metadata
Metadata
Assignees
Labels
No labels