rpk registry schema get
Get a schema by version, ID, GUID, or by an existing schema.
This returns a lookup of an existing schema or schemas in one of a few potential (mutually exclusive) ways:
-
By version, returning a schema for a required subject and version
-
By ID, returning all subjects using the schema, or filtering for one subject
-
By GUID, returning usages of one schema ID per context, optionally filtered by subject or
--schema-context -
By schema, checking if the schema has been created in the subject
GUID lookup requires Redpanda 26.3 or later. Find GUIDs in the output of
rpk registry schema list or rpk registry schema get. Subjects registered
only under other IDs holding the same GUID are not included.
To print the schema, use the --print-schema flag.
To print schema metadata properties, use the --print-metadata flag.
The --print-schema and --print-metadata flags are mutually exclusive.
Examples
This section provides examples of how to use rpk registry schema get.
Get version 1 of the schema in subject foo:
rpk registry schema get foo --schema-version 1
Get every subject and version that uses schema ID 3:
rpk registry schema get --id 3
Look up a schema by GUID across contexts:
rpk registry schema get --guid 8b8bd78e-4456-4c99-8d72-64cbe6177dae
Get the usages of a GUID by subject orders-value in context .team:
rpk registry schema get orders-value --guid 8b8bd78e-4456-4c99-8d72-64cbe6177dae --schema-context .team
Check whether the schema in a file is registered in subject foo:
rpk registry schema get foo --schema path/to/file.avro
Print the latest schema of subject foo:
rpk registry schema get foo --schema-version latest --print-schema
Flags
| Value | Type | Description |
|---|---|---|
|
bool |
If true, also return deleted schemas. |
|
string |
Schema GUID to look up usages of; subject optional. (New in v26.3.1) |
|
int |
ID to lookup schemas usages of; subject optional. |
|
bool |
Print the schema metadata properties; cannot be combined with |
|
bool |
Prints the schema in JSON format; cannot be combined with |
|
string |
Schema file to check existence of. Must be |
|
string |
Schema version to lookup ( |
|
string |
Schema type of the file used to lookup ( |
Global flags
| Value | Type | Description |
|---|---|---|
|
string |
Redpanda or |
|
stringArray |
Override |
|
bool |
Ignore |
|
string |
|
|
bool |
Enable verbose logging. |