lib/field_struct/avro_schema/kafka/schema_registry.rb
# Check if a schema is compatible with the stored version.
# Returns:
# - true if compatible
# - nil if the subject or version does not exist
# - false if incompatible
# http://docs.confluent.io/3.1.2/schema-registry/docs/api.html#compatibility
Check if a schema is compatible with the stored version.
Check if a schema is compatible with the stored version .
def compatible?(subject, schema, version = 'latest')
          response = post "/compatibility/subjects/#{subject}/versions/#{version}",
                          expects: [200, 404],
                          body: { schema: schema.to_s }
          data = response.to_json
          data.fetch('is_compatible', false) unless data.key?('error_code')
        end
def compatible? ( subject , schema , version = 'latest' ) response = post "/compatibility/subjects/#{subject}/versions/#{version}" , expects : [ 200 , 404 ] , body : { schema : schema . to_s } data = response . to_json data . fetch ( 'is_compatible' , false ) unless data . key? ( 'error_code' ) end
Check if a schema is compatible with the stored version.
Check if a schema is compatible with the stored version .
subject
schema
version