Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-1797

Undefined attribute that is an array fails completing unmarshal

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 1.4.3
    • Component/s: BSON
    • None

      similar to issue https://jira.mongodb.org/browse/GODRIVER-1235

      However, if the json document contains a field that is not defined in the struct and that field happens to be an array, the Skip() call on line 284 os struct_codec.go reads all the way to the end of document (EOD) and the DecodeValue() returns, it doesn't continue parsing the other fields in the document.  Attached is a series of tests that show the behavior.  I don't see any struct flags and or other flags to change this behavior. 

      If an undefined field is a primitive (string, int, etc), the parser works fine.  If the  undefined field is another struct/map the parser works fine.

        1. codec2_test.go
          2 kB
          Tyson Henry

            Assignee:
            benji.rewis@mongodb.com Benji Rewis (Inactive)
            Reporter:
            tyson.henry@burstiq.com Tyson Henry
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: