DOC-1790: Schema Registry Metadata Properties#1690
Conversation
Adds a new section covering metadata properties support in Schema Registry, including API usage, rpk flags, inheritance behavior, and Confluent Data Contracts compatibility notes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
✅ Deploy Preview for redpanda-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughAdded a new documentation section describing how Schema Registry supports arbitrary key-value metadata properties alongside schemas. The section covers request and response formats for registering and retrieving schemas with metadata, provides CLI examples using the Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
modules/manage/pages/schema-reg/schema-reg-overview.adoc (2)
166-178: ⚡ Quick winSeparate endpoint text from the JSON payload example.
The current block is tagged as JSON but includes an HTTP request line, which hurts syntax accuracy and copy/paste usability.
Proposed edit
-[source,json] ----- -POST /subjects/my-topic-value/versions -{ +POST `/subjects/my-topic-value/versions` + +[source,json] +---- +{ "schema": "{\"type\":\"string\"}", "metadata": { "properties": { "owner": "platform-team", "application.version": "2.1.0" } } } ----🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@modules/manage/pages/schema-reg/schema-reg-overview.adoc` around lines 166 - 178, The example mixes an HTTP request line with a JSON code block, so split them: move the "POST /subjects/my-topic-value/versions" request line out of the [source,json] block and place it in its own code block (e.g., [source,http] or a plain example line) and leave only the JSON payload inside the [source,json] block; update the surrounding text to reference the two blocks so the JSON payload and the HTTP request line are separately selectable and properly syntax-highlighted.
191-191: ⚡ Quick winLink
{ui}to the Schema Registry UI page.Making this a cross-reference keeps navigation consistent and improves discoverability.
Proposed edit
-To view metadata on an existing schema, add `--print-metadata` to `rpk registry schema get`. You can also view metadata properties in {ui}. +To view metadata on an existing schema, add `--print-metadata` to `rpk registry schema get`. You can also view metadata properties in xref:manage:schema-reg/schema-reg-ui.adoc[].Based on learnings: AsciiDoc linking should prefer
xref:...[]so target titles render automatically rather than hard-coded link text.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@modules/manage/pages/schema-reg/schema-reg-overview.adoc` at line 191, The AsciiDoc uses the placeholder {ui} in the sentence "You can also view metadata properties in {ui}." — replace that placeholder with an AsciiDoc cross-reference using the xref: syntax pointing to the Schema Registry UI page (e.g., xref:Schema-Registry-UI-Page[]), so the link renders the target title automatically; update the text in schema-reg-overview.adoc where {ui} appears to use xref:...[] instead of the raw variable.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@modules/manage/pages/schema-reg/schema-reg-overview.adoc`:
- Around line 180-189: The example shows use of unsupported rpk flags
(--metadata-properties and -p) when creating a schema; verify against the
current rpk implementation and either remove or replace them with supported
alternatives. Specifically, check the rpk CLI implementation or docs for the
commands used in the schema example and update the sample in
schema-reg-overview.adoc so it no longer references --metadata-properties or -p
(or annotate that metadata is unsupported), and ensure the surrounding text
about metadata on GET /subjects/{subject}/versions/{version} and GET
/schemas/ids/{id} remains accurate.
---
Nitpick comments:
In `@modules/manage/pages/schema-reg/schema-reg-overview.adoc`:
- Around line 166-178: The example mixes an HTTP request line with a JSON code
block, so split them: move the "POST /subjects/my-topic-value/versions" request
line out of the [source,json] block and place it in its own code block (e.g.,
[source,http] or a plain example line) and leave only the JSON payload inside
the [source,json] block; update the surrounding text to reference the two blocks
so the JSON payload and the HTTP request line are separately selectable and
properly syntax-highlighted.
- Line 191: The AsciiDoc uses the placeholder {ui} in the sentence "You can also
view metadata properties in {ui}." — replace that placeholder with an AsciiDoc
cross-reference using the xref: syntax pointing to the Schema Registry UI page
(e.g., xref:Schema-Registry-UI-Page[]), so the link renders the target title
automatically; update the text in schema-reg-overview.adoc where {ui} appears to
use xref:...[] instead of the raw variable.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 72001e41-62a3-461b-b5bd-051e338fbb01
📒 Files selected for processing (1)
modules/manage/pages/schema-reg/schema-reg-overview.adoc
| Metadata properties are returned on `GET /subjects/{subject}/versions/{version}` and `GET /schemas/ids/{id}` responses. Using rpk, pass metadata as `key=value` pairs with `--metadata-properties`, or as a JSON string with `-p`: | ||
|
|
||
| [source,bash] | ||
| ---- | ||
| # key=value pairs | ||
| rpk registry schema create my-subject --schema schema.avsc --metadata-properties owner=platform-team | ||
|
|
||
| # JSON string | ||
| rpk registry schema create my-subject --schema schema.avsc -p '{"owner":"platform-team","application.version":"2.1.0"}' | ||
| ---- |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Find authoritative docs references for schema-create flags and examples.
rg -n --iglob '*.adoc' -C3 '\brpk\s+registry\s+schema\s+create\b|--metadata-properties|(^|[[:space:]])-p([[:space:]]|$)|--print-metadata'Repository: redpanda-data/docs
Length of output: 34818
🏁 Script executed:
# Read the flags section of rpk-registry-schema-create.adoc
cat -n modules/reference/pages/rpk/rpk-registry/rpk-registry-schema-create.adoc | sed -n '48,150p'Repository: redpanda-data/docs
Length of output: 1543
🏁 Script executed:
# Check if there are more flags beyond line 76
wc -l modules/reference/pages/rpk/rpk-registry/rpk-registry-schema-create.adoc
# Also search for any mention of metadata in the entire file
rg -n 'metadata|^-p' modules/reference/pages/rpk/rpk-registry/rpk-registry-schema-create.adocRepository: redpanda-data/docs
Length of output: 138
🏁 Script executed:
# Search entire docs repo for metadata-properties or metadata in schema registry context
rg -n 'metadata-properties|--print-metadata' modules/manage/pages/schema-reg/ modules/reference/pages/rpk/rpk-registry/Repository: redpanda-data/docs
Length of output: 713
Remove or verify these metadata flags against current rpk release; they are not documented in the authoritative rpk registry schema create reference.
The example at lines 185 and 188 uses --metadata-properties and -p for metadata JSON, but these flags do not appear in the official rpk reference documentation (modules/reference/pages/rpk/rpk-registry/rpk-registry-schema-create.adoc). The authoritative flag table lists only: -h/--help, --id, --references, --schema, --schema-version, --type, --config, -X/--config-opt, --format, --profile, and -v/--verbose. Confirm these metadata flags exist in the current rpk version before documenting them.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@modules/manage/pages/schema-reg/schema-reg-overview.adoc` around lines 180 -
189, The example shows use of unsupported rpk flags (--metadata-properties and
-p) when creating a schema; verify against the current rpk implementation and
either remove or replace them with supported alternatives. Specifically, check
the rpk CLI implementation or docs for the commands used in the schema example
and update the sample in schema-reg-overview.adoc so it no longer references
--metadata-properties or -p (or annotate that metadata is unsupported), and
ensure the surrounding text about metadata on GET
/subjects/{subject}/versions/{version} and GET /schemas/ids/{id} remains
accurate.
-p is a shorthand for --metadata-properties (single flag, not two). The flag accepts key=value or JSON, and can be passed multiple times. Uses StringArrayVar to avoid comma conflicts with JSON values. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Joyce Fee <102751339+Feediver1@users.noreply.github.com>
…rence Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Use [,json]/[,bash] shorthand consistent with file conventions - Move POST method/path to prose; JSON block now contains body only - Fix dangling participial: "Using rpk" → "To set metadata using rpk" - Fix NOTE: remove double blank line, use * list markers, fix trailing whitespace, distinguish schema-level features from config options, add link to Confluent Data Contracts spec - Add line continuation to rpk reference examples for readability Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
||
| == Metadata properties | ||
|
|
||
| Schema Registry lets you store and retrieve arbitrary key-value metadata properties alongside schemas. Properties such as `owner`, `team`, or `application.version` travel with the schema through its lifecycle. Send a `POST` request to `/subjects/{subject}/versions` with a `metadata.properties` object in the request body: |
There was a problem hiding this comment.
'Send a 'POST' To do what? Needs rewording
|
|
||
| To view metadata on an existing schema, add `--print-metadata` to `rpk registry schema get`. You can also view metadata properties in {ui}. | ||
|
|
||
| When you register a new schema version without a `metadata` field, the new version automatically inherits properties from the most recent version of that subject. To clear inherited metadata, send `"metadata": null`. Registering the same schema definition with different metadata properties creates a new schema version. |
There was a problem hiding this comment.
not quite clear. You clear it when? when inserting the new version or later? need an example of clearing inherited metadata to clarify
Summary
== Metadata propertiessection toschema-reg-overview.adoc, positioned after== JSON Schemaand before== Next stepsmetadata.properties--metadata-properties(key=value) and-p(JSON string) flags, plus--print-metadatafor viewingnullto clear) and versioning behavior (different metadata = new version)Preview
In Cloud: https://deploy-preview-1690--redpanda-docs-preview.netlify.app/redpanda-cloud/manage/schema-reg/schema-reg-overview/#metadata-properties
Self-Managed: https://deploy-preview-1690--redpanda-docs-preview.netlify.app/current/manage/schema-reg/schema-reg-overview/#metadata-properties
Test plan
{ui}attribute resolves in both cloud and self-hosted builds-pflag name is correct in rpk CLI reference🤖 Generated with Claude Code