Skip to content

Json Merge set null (remove) value for merge pathes (following #1399 and #1437) #1598

@Tetradeus

Description

@Tetradeus

Version : 2.9 r2

Related to #1399 and #1437

Wouldn't it be nice to have an option to enable setting null values at merge pathes ? Ref #1437

Presently in tests about Json merge :

    // Also: nulls better not override
    public void testBeanMergingWithNull() throws Exception
    {
        Config config = MAPPER.readerForUpdating(new Config(5, 7))
                .readValue(aposToQuotes("{'loc':null}"));
        assertNotNull(config.loc);
        assertEquals(5, config.loc.a);
        assertEquals(7, config.loc.b);
    }

What if I really want to be able to set null for loc ? assertNull(config.loc);
Not totally sure, but this would make it Json Merge Patch compatible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions