Skip to main content

latest_version

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

Overview

Namelatest_version
TypeResource
Idconfluent.schema_registry.latest_version

Fields

The following fields are returned by SELECT queries:

The schema.

NameDatatypeDescription
idinteger (int32)Globally unique identifier of the schema
metadataobjectUser-defined metadata
referencesarrayReferences to other schemas
ruleSetobjectSchema rule set
schemastringSchema definition string (example: {"schema": "{"type": "string"}"})
schemaTagsarraySchema tags
schemaTypestringSchema type (example: AVRO)
subjectstringName of the subject (example: User)
versioninteger (int32)Version number

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_latest_with_metadataselectsubjectkey, value, format, deletedRetrieve the latest version with the given metadata.

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
subjectstringSubject under which the schema will be registered
deletedbooleanWhether to lookup deleted schemas
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.)
keystringThe metadata key. Add "?key=key" at the end of the request to match a metadata key. This query parameter can appear multiple times. Each instance is matched with a corresponding value query parameter, in order.
valuestringThe metadata value. Add "?value=value" at the end of the request to match a metadata value. This query parameter can appear multiple times. Each instance is matched with a corresponding key query parameter, in order.

SELECT examples

Retrieve the latest version with the given metadata.

SELECT
id,
metadata,
references,
ruleSet,
schema,
schemaTags,
schemaType,
subject,
version
FROM confluent.schema_registry.latest_version
WHERE subject = '{{ subject }}' -- required
AND key = '{{ key }}'
AND value = '{{ value }}'
AND format = '{{ format }}'
AND deleted = '{{ deleted }}'
;