Skip to content

Commit

Permalink
- adds registration check for deserializer
Browse files Browse the repository at this point in the history
  • Loading branch information
baywet committed Sep 6, 2023
1 parent 726e993 commit 6caa14e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion api_client_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ func RegisterDefaultDeserializer(metaFactory func() s.ParseNodeFactory) {
if err == nil && contentType != "" {
registry := s.DefaultParseNodeFactoryInstance
registry.Lock()
registry.ContentTypeAssociatedFactories[contentType] = factory
if _, ok := registry.ContentTypeAssociatedFactories[contentType]; !ok {
registry.ContentTypeAssociatedFactories[contentType] = factory
}
registry.Unlock()
}
}
Expand Down

0 comments on commit 6caa14e

Please sign in to comment.