Skip to content

fix: detect nullable allOf type conflicts - #58

Open
FanouZeng-TT wants to merge 1 commit into
Universal-Commerce-Protocol:mainfrom
FanouZeng-TT:fix/nullable-allof-type-conflicts
Open

fix: detect nullable allOf type conflicts#58
FanouZeng-TT wants to merge 1 commit into
Universal-Commerce-Protocol:mainfrom
FanouZeng-TT:fix/nullable-allof-type-conflicts

Conversation

@FanouZeng-TT

Copy link
Copy Markdown
Contributor

Description

validate_allof_types only compared string-form type keywords. An array-form type such as ["string", "null"] was skipped, so combining it with "number" in another allOf branch passed resolution even though no JSON instance can satisfy both branches.

Fix: normalize string and array forms into accepted JSON instance-type sets and intersect them across matching properties. Empty intersections keep returning the existing TypeConflict; overlapping nullable types and the JSON Schema number/integer relationship remain valid.

The regression test covers all three boundaries:

  • ["string", "null"] with "number" reports a conflict
  • ["string", "null"] with "string" resolves
  • "number" with "integer" resolves

Category (Required)

  • Core Protocol: Changes to core protocol specifications. (Requires Technical Council approval)
  • Governance/Contributing: Changes to governance or contributing processes. (Requires Governance Council approval)
  • Capability: New or updated capabilities. (Requires Maintainer approval)
  • Documentation: Documentation-only changes. (Requires Maintainer approval)
  • Infrastructure: Build, CI, or deployment changes. (Requires DevOps Maintainer approval)
  • Maintenance: Dependencies and repository maintenance. (Requires DevOps Maintainer approval)
  • SDK: Language-specific SDK updates and releases. (Requires DevOps Maintainer approval)
  • Samples / Conformance: Maintaining samples and the conformance suite. (Requires Maintainer approval)
  • UCP Schema: Changes to the ucp-schema tool. (Requires Maintainer approval)
  • Community Health (.github): Organization-wide community files. (Requires DevOps Maintainer approval)

Related Issues

N/A

Checklist

  • I have followed the Contributing Guide and Code of Conduct.
  • 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 (not applicable).

Screenshots / Logs (if applicable)

N/A — verified with cargo test --all-targets, cargo clippy --all-targets -- -D warnings, cargo fmt --check, and all pre-commit hooks.

@damaz91 damaz91 added status:needs-triage Signal that the PR is ready for human triage status:under-review and removed status:needs-triage Signal that the PR is ready for human triage labels Aug 16, 2026
@damaz91 damaz91 added status:stale-review Applied if a PR is waiting on a reviewer for too long and removed status:under-review labels Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status:stale-review Applied if a PR is waiting on a reviewer for too long

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants