Kijewski / Kijewski/pyjson5

How to detect duplicate keys?

Open
#130 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Cython
Stars
179
Forks
16
PR merge metrics
No merged PRs in 30d

Description

Coming from https://gitlab.com/bmares/check-json5/-/issues/1, I was wondering if there is anything similar to object_pairs_hook from

import json5
json5.load(f, object_pairs_hook=...)

I checked the source code, the documentation and the issues but couldn't find anything related to duplicate key detection. It looks like decode automatically deduplicates the keys and doesn't raise/return any error.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the decode implementation and the existing documentation and issues, then compare the requested behavior with Python's object_pairs_hook. Done should be defined as a documented way to detect duplicate keys instead of silently deduplicating them.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.