Skip to content

merge_patch: inconsistent behaviour merging empty sub-object #1289

@adam-p

Description

@adam-p

When using merge_patch with an object like {{"k", {}}}, different results are obtained than with other methods for providing an empty object.

Example: https://wandbox.org/permlink/7SDUyC98tSZX7sPL

Like...

start with: {"k":{"a":"b"}}

merge_patch({{"k", json({})}}) --> {"k":{"a":"b"}}

merge_patch({{"k", {}}}) --> {}

It may be that I'm confused about what {} means here. If it's equivalent to null, then I think this makes sense. But I don't see anything in the README about that being the case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions