-
Type: Improvement
-
Resolution: Fixed
-
Priority: Unknown
-
Affects Version/s: None
-
Component/s: BSON
-
None
The APIs that accept EncodeContext and DecodeContext create a lot of unnecessary duplication in the bson package API. For example, there are currently multiple ways to configure a bson.Encoder or bson.Decoder:
- Set a Registry directly on the Encoder via SetRegistry.
- Set a Registry in an EncodeContext via SetContext.
Remove all bson APIs that accept an EncodeContext or DecodeContext for configuring a Encoder or Decoder. Keep the EncodeContext and DecodeContext in the ValueEncoder and ValueDecoder APIs.
Definition of done:
- Remove all bson APIs that accept an EncodeContext or DecodeContext for configuring a Encoder or Decoder.
- Add functions to the bson.Encoder API to replace all behaviors configurable via a bson.EncodeContext.
- Add functions to the bson.Decoder API to replace all behaviors configurable via a bson.DecodeContext.