registry icon indicating copy to clipboard operation
registry copied to clipboard

AvroSchemaProvider does not take into account different String representations when canonicalizing

Open radai-rosenblatt opened this issue 7 years ago • 1 comments

avro has a magic property "avro.java.string" that determines the type of a string property in generated java code (java.lang.String vs Utf8 etc) - see https://issues.apache.org/jira/browse/AVRO-803 and https://stackoverflow.com/questions/25118727/how-to-generate-fields-of-type-string-instead-of-charsequence-using-avro

changing the value of this property on a schema, while having no effect on compatibility as far as wire format is concerned (both json and binary) can definitely break code compiled from/against this schema (at least in java).

i think then it should be at least included in the fingerprint, if not also be made part of the validation?

radai-rosenblatt avatar Aug 30 '17 02:08 radai-rosenblatt

@radai-rosenblatt Fingerprint is used in finding out whether the same effective schema w.r.t compatibility already exists in registry with the same schema name, before it is added as new version. When user adds new schema with different avro.java.string types, it should not be added as a new version as it does not change w.r.t compatibility. But validation can be added to check whether avro.java.string is set with right values.

satishd avatar Sep 07 '17 06:09 satishd