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

Add SerializationContext to custom deserializer/serializer for C++ types

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Serverless
    • Fully Compatible
    • Server Serverless 2023-03-06, Server Serverless 2023-03-20

      SerializationContext are currently tied to the `deserialize_with_tenant` flag being used in IDL config files.  In some of these cases, C++ types are imported by defining these types in the IDL config, and they contain custom serializers and deserializers that are called verbatim.

      Specifically, the function _gen_field_deserializer_expression() in the IDL generator will create the custom deserializer, and passes the tenantId in but does not pass the SerializationContext in.  These flags are used in both serialization and deserialization, so we will need to add it for serialization as well (in _gen_serializer_method_custom()), but this might require modifying the behavior of the associated BsonCppTypeBase.

      This will also affect the target C++ files, which currently include auth_name and document_source_merge_spec as per user_management_commands_parser.idl and document_source_merge.idl, respectively.
      In particular, mergeTargetNssParseFromBSON creates an IDLParserContext that will need to be populated with the SerializationContext, while the auth_name changes are only necessary to normalize the function signature.

            Assignee:
            hugh.tong@mongodb.com Hugh Tong (Inactive)
            Reporter:
            hugh.tong@mongodb.com Hugh Tong (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: