question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow failing on duplicate keys

See original GitHub issue

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
    }
``

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:2
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
qwwdfsadcommented, Oct 8, 2022

I honestly was sure that we do fail on duplicate keys and that the request was about allowing duplicate keys, thus misreading the sentence.

The request indeed is reasonable and seems like it should be on by default, though it requires a proper damage assessment.

0reactions
Lysouncommented, Oct 27, 2022

That means that the only way to run the JVM tests is to set java 11 as default version on one’s computer, which can be pretty troublesome when it’s not.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Reasons for "DUPLICATE KEY" errors? - Stack Overflow
It looks like your problem has arisen because you are allowing inserts on more than one node and are using auto-increment fields without ......
Read more >
"Cannot insert duplicate key" error occurs when you update a ...
Fixes an issue in which "Cannot insert duplicate key" error occurs when you update a table by using a bitmap index that contains...
Read more >
How to avoid a "duplicate key" error? - DBA Stack Exchange
The duplicate key error is an expected condition given your description of the calling service. Your procedure needs to expect this error, catch ......
Read more >
Hidden dangers of duplicate key violations in PostgreSQL and ...
The “duplicate key violates unique constraint” error notifies the caller that a retry is needed. This seems like an intuitive approach, ...
Read more >
I'm seeing a duplicate keys error, what does that mean?
When loading data, EasyCatalog will check the contents of the key field columns to determine whether they contain unique values. If they don't,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found