Skip to content

Clarify direct and compound schema fragment selectors - #773

Merged
duglin merged 1 commit into
xregistry:mainfrom
clemensv:issue-737-schema-fragments
Oct 30, 2026
Merged

duglin merged 1 commit into
xregistry:mainfrom
clemensv:issue-737-schema-fragments

Conversation

@clemensv

Copy link
Copy Markdown
Contributor

Clarify how schema references select Avro records and Protobuf messages without losing a fragment that already locates an embedded schema.

Fixes #737.

Changes

  • Use #Name when a URI directly identifies an Avro or Protobuf schema, including Registry-root-relative schema Resource and Version paths.
  • Retain :Name only for two-stage selection: an existing fragment locates an embedded schema document, then the colon suffix selects a declaration within it. Include explicit registry-file examples; do not replace the schema-locating fragment.
  • Preserve Avro's optional selector and Protobuf's required message selector.
  • Correct the JSON Structure example to separate the Registry path from #/definitions/Employee.
  • Correct the CloudEvents example to select #Metrics, use Protobuf/3 consistently, and distinguish direct references from registry-file JSON Pointers.

The CloudEvents example corrections overlap the pending changes in #723. This PR supplies the normative direct-versus-compound selection rules and retains the colon for the embedded-schema case; it does not remove legitimate metadata JSON Pointer references.

Validation

  • py -3 tools\verify.py schema
  • py -3 tools\verify.py cloudevents
  • git diff --check
  • Repository-equivalent spelling checks with CRLF-normalized dictionaries, plus tab, trailing-space, and inline-backtick checks.
  • Semantic checks of all six Avro/Protobuf examples, including JSON Pointer resolution followed by record/message selection; JSON Structure path/fragment separation; and CloudEvents JSON parsing, schema Version target, format identifiers, Metrics declaration, and unchanged metadata pointers.

All six logical changes were reviewed individually and approved before publication.

Use #Name for directly addressed Avro and Protobuf schemas while retaining :Name when an existing fragment locates an embedded schema. Correct the JSON Structure and CloudEvents examples and explain the two selection levels.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Clemens Vasters <clemensv@microsoft.com>
@duglin

duglin commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Approved on the 10/30 call

@duglin
duglin merged commit d290b1e into xregistry:main Oct 30, 2026
2 checks passed
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.

Modify the "fragment" stuff in schema spec

2 participants