Skip to content

Conversation

@daniel7an
Copy link

Summary

When uniqueItems validation fails, the error message now includes which items are duplicated and at what indices.

Before:

[1, 2, 3, 2, 5] has non-unique elements

After:

[1, 2, 3, 2, 5] has non-unique elements (items at index 1 and 3 are equal: 2)

This helps users quickly identify duplicates in large arrays without needing to post-process the validation result.

Closes #1363

When uniqueItems validation fails, the error message now includes
which items are duplicated and at what indices. For example:

  [1, 2, 3, 2, 5] has non-unique elements (items at index 1 and 3 are equal: 2)

This helps users quickly identify duplicates in large arrays without
post-processing the validation result.

Closes python-jsonschema#1363
@Julian Julian closed this Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add more context to the non-unique array item in error

2 participants