Skip to content

Duplicate key detection does not work for java.util.Map #50

@inorick

Description

@inorick

The feature flag FAIL_ON_DUPLICATE_MAP_KEYS does not seem to work. As I understand the parser configuration, the following code should throw an exception but doesnt:

String duplicateKeyString = "{\"a\":1,\"b\":2,\"b\":3,\"c\":4}";`
Map<Object, Object> json = JSON.std
.with(JSON.Feature.FAIL_ON_DUPLICATE_MAP_KEYS)
.mapFrom(duplicateKeyString);

The same is true for this similar call:

JSON.std.with(new JacksonJrsTreeCodec())
.with(JSON.Feature.FAIL_ON_DUPLICATE_MAP_KEYS)
.treeFrom(duplicateKeyString);

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