How to check previous schemas registered in Registry?
I'm trying to register but I am getting "Schema being registered is incompatible with an earlier schema for subject" exception
How to check previous schemas registered in Registry?
I'm trying to register but I am getting "Schema being registered is incompatible with an earlier schema for subject" exception
Compatibility checks will only operate against the latest stored subject version
https://docs.confluent.io/platform/current/schema-registry/develop/api.html#sr-api-compatibility
You'd check the schemas using the subject and version number(s)
Neither will tell you "why" it is incompatible, but Avro has clear documentation on that, for example
You can try the following
SchemaRegistryURL/subjects/topicname-value/versions
SchemaRegistryURL/subjects/topicname-value/versions/version
Schema Compatibility option might not set it correctly, in which case you can reset the Compatibility using the following command and try re-registering your schema.
curl -k -X PUT -H "Content-Type:application/vnd.schemaregistry.v1+json" --data '{"compatibility": "NONE"}' SchemaRegistryURL/config/topic-value
From https://docs.confluent.io/platform/current/schema-registry/avro.html#summary
Compatibility
Transitive compatibility checking is important once you have more than two versions of a schema for a given subject. If compatibility is configured as transitive, then it checks compatibility of a new schema against all previously registered schemas; otherwise, it checks compatibility of a new schema only against the latest schema.
For example, if there are three schemas for a subject that change in order X-2, X-1, and X then:
transitive: ensures compatibility between X-2 <==> X-1 and X-1 <==> X and X-2 <==> X
non-transitive: ensures compatibility between X-2 <==> X-1 and X-1 <==> X, but not necessarily X-2 <==> X
The Confluent Schema Registry default compatibility type BACKWARD is non-transitive, which means that itβs not BACKWARD_TRANSITIVE. As a result, new schemas are checked for compatibility only against the latest schema.
BACKWARD: (default) consumers using X-2 can read data written by producers X-1
BACKWARD_TRANSITIVE: consumers using X-2 can read data written by producers using X-1, and X
FORWARD: consumers using X-1 can read data written by producers using X-2
FORWARD_TRANSITIVE: consumers using X-1 or X can read data written by producers using X-2
FULL: the new schema is forward and backward compatible with the latest registered schema
FULL_TRANSITIVE: the new schema is forward and backward compatible with all previously registered schemas
NONE: schema compatibility checks are disabled
It is explained in Schema Evolution.
The Confluent Schema Registry default compatibility type is BACKWARD so you cannot add more fields or change datatype.
You need to change the compatibility.