Skip to main content

schemas

Creates, updates, deletes, gets or lists a schemas resource.

Overview

Nameschemas
TypeResource
Idconfluent.schema_registry.schemas

Fields

The following fields are returned by SELECT queries:

The schema string.

NameDatatypeDescription
maxIdinteger (int32)Maximum ID
metadataobjectUser-defined metadata
referencesarrayReferences to other schemas
ruleSetobjectSchema rule set
schemastringSchema string identified by the ID (example: {"schema": "{"type": "string"}"})
schemaTagsarraySchema tags
schemaTypestringSchema type (example: AVRO)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_schemaselectidsubject, formatRetrieves the schema string identified by the input ID.
get_schemasselectsubjectPrefix, aliases, deleted, latestOnly, ruleType, offset, limitGet the schemas matching the specified parameters.
get_schema_onlyexecidsubject, formatRetrieves the schema identified by the input ID.
get_schema_only_1execsubject, versiondeletedRetrieves the schema for the specified version of this subject. Only the unescaped schema string is returned.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
idinteger (int32)Globally unique identifier of the schema
subjectstringName of the subject
versionstringVersion of the schema to be returned. Valid values for versionId are between [1,2^31-1] or the string "latest". "latest" returns the last registered schema under the specified subject. Note that there may be a new latest schema that gets registered right after this request is served.
aliasesbooleanWhether to include aliases in the search
deletedbooleanWhether to include deleted schema
formatstringDesired output format, dependent on schema type. For AVRO schemas, valid values are: " " (default) or "resolved". For PROTOBUF schemas, valid values are: " " (default), "ignore_extensions", or "serialized" (The parameter does not apply to JSON schemas.)
latestOnlybooleanWhether to return latest schema versions only for each matching subject
limitinteger (int32)Pagination size for results. Ignored if negative
offsetinteger (int32)Pagination offset for results
ruleTypestringFilters results by the given rule type
subjectstringName of the subject
subjectPrefixstringFilters results by the respective subject prefix

SELECT examples

Retrieves the schema string identified by the input ID.

SELECT
maxId,
metadata,
references,
ruleSet,
schema,
schemaTags,
schemaType
FROM confluent.schema_registry.schemas
WHERE id = '{{ id }}' -- required
AND subject = '{{ subject }}'
AND format = '{{ format }}'
;

Lifecycle Methods

Retrieves the schema identified by the input ID.

EXEC confluent.schema_registry.schemas.get_schema_only
@id='{{ id }}' --required,
@subject='{{ subject }}',
@format='{{ format }}'
;