Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-2618

Create an "extjson" package for the Extended JSON marshaler/unmarshaler

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Do
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None

      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.

            Assignee:
            Unassigned Unassigned
            Reporter:
            matt.dale@mongodb.com Matt Dale
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: