Skip to content

Allow failing on duplicate keys #1990

Open
@tjerkw

Description

@tjerkw

WHY

The JSON format allows for duplicate keys in objects:

{'a': 2, 'a': 4}

but the spec says it "SHOULD" not be done.

Different parsers implement it differently.
It would by nice to configure the Json parses to fail on duplicate keys

HOW

Allow a setting on Json to fail on duplicate keys:

val json = kotlinx.serialization.json.Json {
        ignoreDuplicateKeys = false (default should be true
    }
``

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions