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

SkipName should also skip type descriptor instead of throwing an error

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • 2.7.0
    • BSON
    • None
    • Minor Change

    Description

      ReadName() will read bson-type if there is one at current position and read the name.

      SkipName() does not read bson-type and will only skip the name. 

       

      In short: a user of SkipName() likely wants to skip the BsonReaderState.Type also. 

       

      I think it would be better if SkipName() would internally check if there is a bson type to read and if the bson-type is not equal name description it might throw an error.

      It should just skip the name description bson-type, because that is what one would suspect if using this api.

       

      One has to replace ReadName() with ReadType() and SkipName().

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            bpiorczig Benjamin Piorczig
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: