diff --git a/schema_compatibility.go b/schema_compatibility.go index 864a52f..0b1d9ac 100644 --- a/schema_compatibility.go +++ b/schema_compatibility.go @@ -179,7 +179,7 @@ func (c *SchemaCompatibility) match(reader, writer Schema) error { } func (c *SchemaCompatibility) checkSchemaName(reader, writer NamedSchema) error { - if reader.FullName() != writer.FullName() { + if reader.Name() != writer.Name() { if c.contains(reader.Aliases(), writer.FullName()) { return nil } diff --git a/schema_compatibility_test.go b/schema_compatibility_test.go index 73a6670..5ffae6e 100644 --- a/schema_compatibility_test.go +++ b/schema_compatibility_test.go @@ -239,6 +239,12 @@ func TestSchemaCompatibility_Compatible(t *testing.T) { writer: `{"type":"record", "name":"test", "namespace": "org.hamba.avro", "fields":[{"name": "a", "type": "test"}]}`, wantErr: assert.NoError, }, + { + name: "Comparison with different namespaces", + writer: `{"type":"record", "name":"Obj", "namespace": "ns", "fields":[{"name": "a", "type": "int"}]}`, + reader: `{"type":"record", "name":"Obj", "fields":[{"name": "a", "type": "int"}]}`, + wantErr: assert.NoError, + }, } for _, test := range tests {