SkipName should also skip type descriptor instead of throwing an error

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Won't Do
    • Priority: Major - P3
    • None
    • Affects Version/s: 2.7.0
    • Component/s: BSON
    • None
    • None
    • 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

      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().

       

            Assignee:
            Unassigned
            Reporter:
            Benjamin Piorczig
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: