Skip to content

Commit

Permalink
fix: schema compatibility compliance
Browse files Browse the repository at this point in the history
  • Loading branch information
timmyb32r authored May 18, 2024
1 parent dc715a4 commit aff3955
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion schema_compatibility.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
6 changes: 6 additions & 0 deletions schema_compatibility_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit aff3955

Please sign in to comment.