Skip to content

fix: scope uniqueItems validators to declaring classes - #61

Open
horaceewang-TT wants to merge 1 commit into
Universal-Commerce-Protocol:mainfrom
horaceewang-TT:fix/unique-items-scoped-injection
Open

fix: scope uniqueItems validators to declaring classes#61
horaceewang-TT wants to merge 1 commit into
Universal-Commerce-Protocol:mainfrom
horaceewang-TT:fix/unique-items-scoped-injection

Conversation

@horaceewang-TT

Copy link
Copy Markdown

Description

Scopes uniqueItems validators to the generated classes that declare the constraint.

Previously, validators were matched globally by field name, causing unrelated classes with same-named list fields to receive validators incorrectly. Schema scanning now preserves class ownership, and regression tests verify that only the declaring class is patched.

Category (Required)

  • Maintenance: Version bumps, lockfile updates, or minor bug fixes.
  • SDK: Language-specific SDK updates and releases.

Related Issues

#60

Checklist

  • I have followed the https://github.com/Universal-Commerce-Protocol/.github/blob/main/CONTRIBUTING.md (including Conventional Commits title requirements and ! for breaking changes).
  • I have updated the documentation (if applicable).
  • My changes pass all local linting and formatting checks.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • (For Core/Capability) I have included/updated the relevant JSON schemas.
  • I have regenerated Python Pydantic models by running generate_models.sh under python_sdk.

Screenshots / Logs (if applicable)

Ran 45 tests in 0.029s.

OK (skipped=15)

Formatting and linting checks passed.

Runtime verification:

  • First.tags rejects duplicate values with a ValidationError.
  • Second.tags accepts duplicate values because it does not declare uniqueItems.
  • Exactly one uniqueItems validator is injected.

@google-cla

google-cla Bot commented Aug 3, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@damaz91 damaz91 added the status:needs-triage Signal that the PR is ready for human triage label Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status:needs-triage Signal that the PR is ready for human triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants