Skip to content

Commit

Permalink
Use schema ID returned from GetID() (fixes #848) (#870)
Browse files Browse the repository at this point in the history
  • Loading branch information
perdue authored and PrasanthV454 committed Jan 12, 2023
1 parent 393b43b commit 32d864d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion schemaregistry/serde/serde.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,13 @@ func (s *BaseSerializer) GetID(topic string, msg interface{}, info schemaregistr
if err != nil {
return -1, err
}
_, err := s.Client.GetID(subject, info, false)
id, err = s.Client.GetID(subject, info, false)
if err != nil {
return -1, err
}
if id != useSchemaID {
return -1, fmt.Errorf("failed to match schema ID (%d != %d)", id, useSchemaID)
}
} else if useLatest {
metadata, err := s.Client.GetLatestSchemaMetadata(subject)
if err != nil {
Expand Down

0 comments on commit 32d864d

Please sign in to comment.