Skip to content

fix: skip ref checks in instance data - #63

Open
FanouZeng-TT wants to merge 1 commit into
Universal-Commerce-Protocol:mainfrom
FanouZeng-TT:fix/skip-ref-instance-recursion
Open

fix: skip ref checks in instance data#63
FanouZeng-TT wants to merge 1 commit into
Universal-Commerce-Protocol:mainfrom
FanouZeng-TT:fix/skip-ref-instance-recursion

Conversation

@FanouZeng-TT

Copy link
Copy Markdown
Contributor

Description

check_refs currently walks every object and array value in a schema. default, const, examples, and enum hold JSON instance data, so a business field named $ref in one of those values was treated as a schema reference and reported as E002.

Fix: skip those instance-data keyword values during reference traversal while preserving checks at real schema locations. The regression test covers all four keyword values and the existing broken-reference tests continue to cover real $ref values.

Category (Required)

  • Core Protocol: Changes to core protocol specifications, breaking changes, or extensions. (Requires Technical Council approval)
  • Governance/Contributing: Changes to governance documentation or contribution guidelines. (Requires Governance Council approval)
  • Capability: Changes to a capability specification. (Requires Maintainer approval)
  • Documentation: Documentation-only changes. (Requires Maintainer approval)
  • Infrastructure: CI, build, or developer tooling changes. (Requires DevOps Maintainer approval)
  • Maintenance: Dependencies or 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): Community health files. (Requires DevOps Maintainer approval)

Related Issues

N/A

Checklist

  • I have followed the Contributing Guide.
  • 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)

  • cargo test --manifest-path /Users/bytedance/All/UCP/PR记录/worktrees/73-ucp-schema/Cargo.toml --all-targets
  • cargo clippy --manifest-path /Users/bytedance/All/UCP/PR记录/worktrees/73-ucp-schema/Cargo.toml --all-targets -- -D warnings
  • cargo fmt --manifest-path /Users/bytedance/All/UCP/PR记录/worktrees/73-ucp-schema/Cargo.toml -- --check
  • uvx pre-commit run --all-files --show-diff-on-failure
  • git diff --check

@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