lib/avromatic/schema_registry_patch.rb in avromatic-0.20.0 vs lib/avromatic/schema_registry_patch.rb in avromatic-0.21.0.rc0
- old
+ new
@@ -28,9 +28,17 @@
data = get("/subjects/#{subject}/fingerprints/#{schema_object.sha256_resolution_fingerprint.to_s(16)}")
id = data.fetch('id')
@logger.info("Found schema for subject `#{subject}`; id = #{id}")
id
end
+
+ # Override to add support for additional params
+ def compatible?(subject, schema, version = 'latest', **params)
+ data = post("/compatibility/subjects/#{subject}/versions/#{version}",
+ expects: [200, 404],
+ body: { schema: schema.to_s }.merge!(params).to_json)
+ data.fetch('is_compatible', false) unless data.key?('error_code')
+ end
end
end
AvroTurf::ConfluentSchemaRegistry.prepend(Avromatic::CacheableSchemaRegistration)