[GODRIVER-2618] Create an "extjson" package for the Extended JSON marshaler/unmarshaler Created: 26/Oct/22  Updated: 02/Mar/23  Resolved: 24/Dec/22

Status: Closed
Project: Go Driver
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Unknown
Reporter: Matt Dale Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by GODRIVER-612 Remove duplicated Extended JSON logic... Backlog
is depended on by GODRIVER-2591 Make all BSON types (bson.D, bson.M, ... Backlog
is depended on by GODRIVER-2617 Remove or un-export all currently dep... Closed

 Description   

Separate the Extended JSON marshaler/unmarshaler into a separate extjson package that is a sibling package to the bson package (i.e. go.mongodb.org/mongo-driver/extjson). Also deprecate all of the Extended JSON marshaler/unmarshaler functions in the bson package.

Motivation

Usability

The BSON and Extended JSON formats are completely separate, so they should be in separate packages.

For example bson.MarshalExtJSON is confusing because the format is not BSON, it's Extended JSON.

Code Separation

Based on the background of GODRIVER-612, keeping the BSON and Extended JSON marshaler/unmarshaler in the same package seems to create unnecessary duplication in the bsoncore package due to the dependency chain of bson -> bsonrw -> bsoncore. Avoid that problem by completely separating the Extended JSON marshaler/unmarshaler.

Definition of done

  • Create a new extjson package that provides an Extended JSON marshaler/unmarshaler. Make it a sibling of the bson package.
    • The extjson package cannot import any bson or bsoncore packages because those packages need to be able to reference extjson for BSON-to-JSON and BSON-to-string conversion.
  • Deprecate all Extended JSON functions and types in the bson package.


 Comments   
Comment by Matt Dale [ 24/Dec/22 ]

Abandoning this in favor of merging all BSON packages together and significantly simplifying the BSON library API.

Generated at Thu Feb 08 08:39:01 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.