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
With #1980 there are new methods/overloads for withArray() and with(), which take JsonPointer.
The old methods that take String should be retrofitted in 2.x so that:
If argument is valid JsonPointer (that is, starts with leading '/` or is empty String ""), it should be used as such
Only if argument is not a valid JsonPointer, should it check existing property.
For Jackson 3.0 we can just drop the check and expect valid JsonPointer String representation.
The reason for change is to make expected main use case work, while retaining reasonable backwards-compatibility.
The text was updated successfully, but these errors were encountered:
cowtowncoder
changed the title
Change JsonNode.with(String) and withArray(String) to consider argument as JsonPointer (if valid)
Change JsonNode.with(String) and withArray(String) to consider argument as JsonPointer if valid expression
Aug 10, 2022
The reason for change is to make expected main use case work, while retaining reasonable backwards-compatibility.
For the corner case where a user is creating/fetching keys that start with a forward slash this change is unequivocally not backwards compatible. Given that with was deprecated as part of #3535 did its behaviour really need to change...
(I'm not personally effected by this change, was just wondering what the closest replacement for the deprecated with() method was as the Javadoc didn't provide a suggestion, and was surprised to see the JsonPointer parsing logic. As far as I can see there isn't an exact replacement if you want your input interpreted as a literal key. For my use case putObject was actually appropriate)
With #1980 there are new methods/overloads for
withArray()
andwith()
, which takeJsonPointer
.The old methods that take
String
should be retrofitted in 2.x so that:JsonPointer
(that is, starts with leading '/` or is empty String ""), it should be used as suchJsonPointer
, should it check existingproperty
.For Jackson 3.0 we can just drop the check and expect valid
JsonPointer
String representation.The reason for change is to make expected main use case work, while retaining reasonable backwards-compatibility.
The text was updated successfully, but these errors were encountered: