Thanks to visit codestin.com
Credit goes to github.com

Skip to content

sr: add support for schema guid#1358

Open
kaiwenleee wants to merge 1 commit into
twmb:masterfrom
kaiwenleee:feat/schema-guid
Open

sr: add support for schema guid#1358
kaiwenleee wants to merge 1 commit into
twmb:masterfrom
kaiwenleee:feat/schema-guid

Conversation

@kaiwenleee

Copy link
Copy Markdown

Confluent 8.x introduced Schema GUID, which is another schema identifier to be used in message header instead of payload prefix.

I'd like to add basic support for this new field in schema registry client:

  • Add GUID field in SubjectSchema struct
  • Add new API GET /schemas/guids/{guid}

Reference:
https://www.confluent.io/blog/schema-id-kafka-headers-data-governance/
https://docs.confluent.io/platform/current/schema-registry/develop/api.html#get-schema-by-guid

Comment thread pkg/sr/api.go
ID int `json:"id,omitempty"`

// GUID is the globally unique ID of the schema used in Kafka header.
GUID string `json:"guid,omitempty"`

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Both this and the ID above are doc'd as "the globally unique ID of the schema", so it's hard to tell them apart. I suggest changing this to:

// GUID is the globally unique string identifier of the schema,
// carried in the Kafka record header rather than the payload
// prefix. Introduced in Confluent Platform 8.x.

while also changing the doc on ID above to:

// ID is the unique numeric identifier of the schema within the registry.

@twmb

twmb commented Jul 3, 2026

Copy link
Copy Markdown
Owner

I've built on top of your PR in #1361, I'll go ahead with that one and close this (your commit is the first in that new branch, I just covered a few other API surfaces that were not implemented and found when auditing this).

@kaiwenleee

Copy link
Copy Markdown
Author

Thank you :D

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