latest_version
Creates, updates, deletes, gets or lists a latest_version resource.
Overview
| Name | latest_version |
| Type | Resource |
| Id | confluent.schema_registry.latest_version |
Fields
The following fields are returned by SELECT queries:
- get_latest_with_metadata
The schema.
| Name | Datatype | Description |
|---|---|---|
id | integer (int32) | Globally unique identifier of the schema |
metadata | object | User-defined metadata |
references | array | References to other schemas |
ruleSet | object | Schema rule set |
schema | string | Schema definition string (example: {"schema": "{"type": "string"}"}) |
schemaTags | array | Schema tags |
schemaType | string | Schema type (example: AVRO) |
subject | string | Name of the subject (example: User) |
version | integer (int32) | Version number |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_latest_with_metadata | select | subject | key, value, format, deleted | Retrieve 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.
| Name | Datatype | Description |
|---|---|---|
subject | string | Subject under which the schema will be registered |
deleted | boolean | Whether to lookup deleted schemas |
format | string | Desired 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.) |
key | string | The 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. |
value | string | The 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
- get_latest_with_metadata
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 }}'
;