Skip to content

renameKey throws PathNotFoundException even if SUPPRESS_EXCEPTIONS is set #537

Closed
@demonbug

Description

@demonbug

version 2.3.0

Configuration jsonConf = Configuration.defaultConfiguration().addOptions(Option.SUPPRESS_EXCEPTIONS);

JsonPath.using(jsonConf).parse("{}").read("missing");
JsonPath.using(jsonConf)
.parse("{"list":[{"data":{"old":1}},{"data":{}},{"data":{"old":2}}]}")
.renameKey("$..data", "old", "new");

read will not throw PathNotFoundException but renameKey will.
in this case, old:1 will be renamed, but old:2 will not

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions