lib/avromatic/schema_registry_patch.rb in avromatic-0.18.1 vs lib/avromatic/schema_registry_patch.rb in avromatic-0.19.0
- old
+ new
@@ -1,7 +1,8 @@
require 'avro_turf'
require 'avro_turf/confluent_schema_registry'
+require 'avro-resolution_canonical_form'
module Avromatic
module CacheableSchemaRegistration
# Override register to first check if a schema is registered by fingerprint
def register(subject, schema)
@@ -22,10 +23,10 @@
Avro::Schema.parse(schema)
else
schema
end
- data = get("/subjects/#{subject}/fingerprints/#{schema_object.sha256_fingerprint.to_s(16)}")
+ 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
end