You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
Agreed with all of above. If users need appending versions it makes sense to have a safe way to do that -- but also make them aware of efficiency aspects.
A note on complexity/overhead would be useful since as you point out, tail-append is much costlier than head-append (but alas, users mostly need tail one :) ).
Not sure if the warning is useful though, as head-append is protected and not provided as public API method. The main method to generate JsonPointer is JsonPointer#compile with full path expression, and it is used for both tail-append and head-append.
However, warning is added for future updates and internal API usage.
When working heavily with JsonPointers, the following patterns usually emerges:
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.
The text was updated successfully, but these errors were encountered: