Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rpk: add support to produce/consume with jsonschema #20820

Merged
merged 2 commits into from
Jul 3, 2024

Conversation

r-vasquez
Copy link
Contributor

@r-vasquez r-vasquez commented Jul 2, 2024

Now rpk support "encoding" and "decoding" records using JSON schemas in the schema registry. rpk will validate the record before decoding or encoding it.

Along with #19947 and #20757 this completes the support of JSON schemas in rpk.

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v24.1.x
  • v23.3.x
  • v23.2.x

Release Notes

Features

  • rpk: Add support to JSON Schema to rpk, now supported in rpk registry and rpk topic produce/consume

gene-redpanda
gene-redpanda previously approved these changes Jul 3, 2024
Comment on lines +51 to +57
// Append the magic byte + the schema ID bytes.
var serdeHeader sr.ConfluentHeader
h, err := serdeHeader.AppendEncode(nil, schemaID, nil)
if err != nil {
return nil, fmt.Errorf("unable to append header: %v", err)
}
return append(h, record...), nil
Copy link
Contributor

Choose a reason for hiding this comment

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

Not worth it in this PR, but I wonder if we can have a fast follow up commit that does this prefix appending in a wrapper function in pkg/serde/serde.go

@r-vasquez r-vasquez merged commit 413d0c7 into redpanda-data:dev Jul 3, 2024
23 checks passed
@r-vasquez r-vasquez deleted the jsonschema-serde branch September 9, 2024 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants