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

An ignored BsonElement with a prefix of a known BsonElement's causes an EndOfStreamException

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Critical - P2 Critical - P2
    • 2.0.1, 2.1
    • Affects Version/s: 2.0
    • Component/s: Serialization
    • Labels:
      None
    • Environment:
      MongoDB C# Legacy Driver version 2.0

      This occurs when a class map is being deserialized which includes a non-mapped element which is the prefix of a mapped element. For example, given the class map:

      [BsonIgnoreExtraElements]
      public class Test
      {
      	public int Longer { get; set; }
      }
      

      Attempting to deserialize the document:

      { Long: 20 }
      

      will result in an EndOfStreamException.

            Assignee:
            craig.wilson@mongodb.com Craig Wilson
            Reporter:
            pgordon@truckdown.com Peter Gordon
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: