Skip to content

Conversation

@chrisjsewell
Copy link
Member

@chrisjsewell chrisjsewell commented Dec 21, 2025

This PR adds support for the uniqueItems validation constraint to array schema fields, enabling validation that all elements in an array must be unique when this constraint is set to true.

Seea also: https://json-schema.org/understanding-json-schema/reference/array#uniqueItems

@chrisjsewell chrisjsewell requested a review from Copilot December 21, 2025 17:30
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for the uniqueItems validation constraint to array schema fields, enabling validation that all elements in an array must be unique when this constraint is set to true.

Key Changes:

  • Added uniqueItems boolean field to array schema type definitions
  • Implemented test case verifying validation error when duplicate array items are present
  • Updated documentation to describe the new uniqueItems constraint

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/schema/fixtures/extra_options.yml Added test fixture with uniqueItems: true and duplicate array items
tests/schema/snapshots/test_schema.ambr Added expected validation error snapshot for unique items constraint
sphinx_needs/schema/jsons/SchemasRootType.schema.json Added uniqueItems field to array schema definition
sphinx_needs/schema/jsons/ExtraOptionMultiValueSchemaType.schema.json Added uniqueItems field to multi-value array schema definition
sphinx_needs/schema/config.py Added uniqueItems TypedDict field with documentation
docs/schema/index.rst Documented the new uniqueItems constraint for array fields

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@chrisjsewell chrisjsewell requested a review from ubmarco December 21, 2025 17:35
@codecov
Copy link

codecov bot commented Dec 21, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.15%. Comparing base (4e10030) to head (18e3699).
⚠️ Report is 217 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1610      +/-   ##
==========================================
+ Coverage   86.87%   88.15%   +1.27%     
==========================================
  Files          56       70      +14     
  Lines        6532     9701    +3169     
==========================================
+ Hits         5675     8552    +2877     
- Misses        857     1149     +292     
Flag Coverage Δ
pytests 88.15% <100.00%> (+1.27%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

2 participants