[GODRIVER-1235] Extended JSON can fail to parse if undefined document field contains a document or an array Created: 13/Aug/19 Updated: 28/Oct/23 Resolved: 09/Dec/20 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | JSON & ExtJSON |
| Affects Version/s: | None |
| Fix Version/s: | 1.4.5 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Matthew Chiaravalloti | Assignee: | Benji Rewis (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Description |
|
NEW: If a source extjson document contains a document field that is not represented in the target struct and that document contains a nested document or array, unmarshalling can fail or incorrectly skip too many fields.
ORIGINAL: The (extJSONValueReader).Skip() method fails when it tries to skip a document that has a document as a child. Specifically, the following test fails on the last line with the error "invalid request to read embedded document":
That error comes from the extJSONParser.readValue() method which cannot read a whole embedded document. I believe the fix for this is to check in Skip() if the type is an embedded document and handle it appropriately there. |
| Comments |
| Comment by Githook User [ 09/Dec/20 ] |
|
Author: {'name': 'Benjamin Rewis', 'email': '32186188+benjirewis@users.noreply.github.com', 'username': 'benjirewis'}Message: |
| Comment by Githook User [ 09/Dec/20 ] |
|
Author: {'name': 'Benjamin Rewis', 'email': '32186188+benjirewis@users.noreply.github.com', 'username': 'benjirewis'}Message: |
| Comment by Benji Rewis (Inactive) [ 30/Nov/20 ] |