Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-73463

Investigate IDL type serializers not being treated as free functions

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None
    • Server Security
    • ALL

    Description

      Given an IDL type definition like:

        mytype:
        bson_serialization_type: any
        cpp_type: MyType
        deserializer: "mongo::parseMyType"
        serializer: "::mongo::serializeMyType"
      

      Serialization will call `mongo::serializeMyType(const MyType& val, StringData fieldName, BSONObjBuilder* builder)`, however when the serialization type is narrowed, such as the following, the "::" prefix denoting a free function is ignored, and the type is serialized as `myType.serializeMyType(StringData fieldName, BSONObjBuilder* builder) const`.

        mytype:
        bson_serialization_type: [int, long, decimal, double]
        cpp_type: MyType
        deserializer: "mongo::parseMyType"
        serializer: "::mongo::serializeMyType"
      

      The behavior current exhibited by the `any` case at top is correct, while the more narrow type below is not.

      Attachments

        Activity

          People

            backlog-server-security Backlog - Security Team
            sara.golemon@mongodb.com Sara Golemon
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: