Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-5498

Registering a GuidSerializer has no effect on ObjectSerializer

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 3.0.0
    • Component/s: Serialization
    • None
    • Dotnet Drivers
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      Since version 3.0.0 of the library developers have to specify the kind of GuidRepresentation they want to use, usually by registering their `GuidSerializer` globally.
      The issue is that `ObjectSerializer` has its own guid serializer inside, that is not affected by the `GuidSerializer` configured globally. This causes confusion in developers, for example here: https://www.mongodb.com/community/forums/t/c-driver-mongo-db-bsonserializationexception-when-using-iaggregatefluentextensions-graphlookup-with-guids/312739

      Another issue is that there is no constructor of `ObjectSerializer` that takes only the `BsonGuidRepresentation` as input, but at least developers also need to pass the discriminator convention, that is not something easily understandable.

            Assignee:
            Unassigned Unassigned
            Reporter:
            ferdinando.papale@mongodb.com Ferdinando Papale
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: