Skip to content

[Variant] ObjectBuilder does not reliably check for duplicates #8170

@scovich

Description

@scovich

Describe the bug

When duplicate detection is enabled, ObjectBuilder::try_insert or ObjectBuilder::try_with_field detect duplicate field names, but ObjectBuilder::new_list and ObjectBuilder::new_object do not.

To Reproduce

Just invoke either of those methods with a duplicate key -- no error.

Expected behavior

An error should be flagged.

Additional context

Found as part of

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions