Rest API
Register Schema
POST /subjects/$SUBJECT/versions?normalize=[true/false]
Registers the schema under given $SUBJECT
only if the new schema is compatible.
normalize
is false by default. If passed, the schema will be normalized.
Normalization enables semantically same but syntactically different schemas to be accounted as the same schema.
Success Response:
The schema ID returned as the response:
Fail Response:
Check schema
POST /subjects/$SUBJECT?normalize=[true/false]&deleted=[true/false]
Check if the given schema is registered under the $SUBJECT
. Returns the schema along with subject, version, and schema type.
normalize
is false by default. If set to true
, the schema will be normalized.
Normalization enables semantically same but syntactically different schemas to be accounted as the same schema.
deleted
is false by default. If set to true
, the soft-deleted schemas under the subject will also be taken into account.
See Delete Subject or Delete Schema for details.
Fail Response
Set Config
PUT /config
Sets the global compatibility. Global compatibility is effective if a subject is not assigned a compatibility by default. See Compatiblity for options.
PUT /config/$SUBJECT
Sets the compatibility of a subject. See Compatiblity for options.
Success Response:
Fail Response
Get Config
GET /config
Retrieves the global config. Note that the default global config is BACKWARD_TRANSITIVE
by default if not set.
GET /config/$SUBJECT?defaultToGlobal=[true/false]
Retrieves the config of the given $SUBJECT
.
defaultToGlobal
is false by default. When set to true
, this endpoint will show the effective compatibility on a register
operation. When set to false
, it may return 404 Not found if a subject level compatibility is not set.
Success Response:
Fail Response
Get All Schemas
GET /schemas?deleted=[false/true]
Returns all schemas registered under subjects. Note that this endpoint will return the same schema multiple times if the same schema registered under different subjects.
deleted
is false by default. If set to true
, the soft-deleted schemas under the subject will also be taken into account.
See Delete Subject or Delete Schema for details.
Success Response:
Fail Response
Get Schema With SchemaId
GET /schemas/ids/$SCHEMA_ID
Returns the schema corresponding to the given $SCHEMA_ID
.
Success Response:
Fail Response
GET /schemas/ids/$SCHEMA_ID/schema
Returns the schema corresponding to the given $SCHEMA_ID
. Additionally unwraps the inner schema field.
Success Response:
Fail Response
Get Schema With Subject And Version
GET /subjects/$SUBJECT/versions/$VERSION?deleted=[true/false]
Returns the schema with its metadata corresponding to the given $SUBJECT
and $VERSION
.
VERSION could be an int or string latest
.
deleted
is false by default. If set to true
, the soft-deleted schemas under the subject will also be taken into account.
See Delete Subject or Delete Schema for details.
Success Response:
Fail Response
GET /subjects/$SUBJECT/versions/$VERSION?deleted=[true/false]
Returns only the schema corresponding to the given $SUBJECT
and $VERSION
.
VERSION could be an int or string latest
.
deleted
is false by default. If set to true
, the soft-deleted schemas under the subject will also be taken into account.
See Delete Subject or Delete Schema for details.
Success Response:
Fail Response
Get All Subjects
GET /subjects?deleted=[false/true]
Returns all subjects.
deleted
is false by default. If set to true
, the soft-deleted subjects will also be taken into account.
See Delete Subject or Delete Schema for details.
Success Response:
Fail Response
Get Subject Versions
GET /subjects/$SUBJECT/versions?deleted=[false/true]
Returns the versions of the given $SUBJECT
.
deleted
is false by default. If set to true
, the soft-deleted subject versions will also be taken into account.
See Delete Subject or Delete Schema for details.
Success Response:
Fail Response
Delete Subject
DELETE /subjects/$SUBJECT?permanent=[true/false]
Deletes the given $SUBJECT
. Returns the deleted versions as the response.
This endpoint should rarely be needed in production and needs to be used with caution. The use-case for this endpoint is mostly cleaning up the resources after testing in development environments.
permanent
is false by default. In this case, the subject only will be soft-deleted. The corresponding schemas and schema-ids
will not be deleted. Any serializer/deserializer needing these schemas still will be able to use them.
if permanent
is set to true. The schemas and schema-ids will also be deleted from the system only if these schemas are not
registered under any other subjects. The schemas will be deleted only after the last related subject is permanently deleted.
Note that a subject can not be permanently deleted before it is soft-deleted.
Success Response:
Returns the deleted versions as the response.
Fail Response:
Delete Schema
DELETE /subjects/$SUBJECT/versions/$VERSION?permanent=[true/false]
Deletes the schema corresponding to the $SUBJECT
and $VERSION
. Returns the version as the response.
VERSION could be an int or string latest
.
This endpoint should rarely be needed in production and needs to be used with caution. The use-case for this endpoint is mostly cleaning up the resources after testing in development environments.
permanent
is false by default. In this case, the subject-version only will be soft-deleted. The corresponding schema and schema-id
will not be deleted. Any serializer/deserializer needing this schema still will be able to use them.
if permanent
is set to true. The schema and schema-id will also be deleted from the system only if this schema is not
registered under any other subjects. The schemas will be deleted only after the last related subject is permanently deleted.
Note that a subject-version can not be permanently deleted before it is soft-deleted.
Success Response:
Returns the deleted version as the response.
Fail Response:
Was this page helpful?