python-jsonschema / python-jsonschema/jsonschema
Add more context to the non-unique array item in error
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 5k
- Forks
- 671
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 10
Description
Resolving validation errors caused by array items defined as unique requires post-processing the result to find the dups.
To illustrate, a validation of an array with 100s of items results in vague error of:
<array> has non-unique elements
Enriching ValidationError with additional exact context as an index/duplicated item would help a lot.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how ValidationError is produced for array items defined as unique, then inspect the validation path that currently reports “ has non-unique elements.” Done means the error exposes exact context such as the relevant index and duplicated item, avoiding post-processing to locate duplicates.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100