Skip to content

Change JsonNode.with(String) and withArray(String) to consider argument as JsonPointer if valid expression #3568

@cowtowncoder

Description

@cowtowncoder

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:

  1. If argument is valid JsonPointer (that is, starts with leading '/` or is empty String ""), it should be used as such
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions