[GODRIVER-562] JSON decoding of an objectid returns error Created: 17/Sep/18 Updated: 28/Oct/23 Resolved: 11/Oct/18 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | BSON |
| Affects Version/s: | 0.0.13 |
| Fix Version/s: | 0.0.16 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Delio D'Anna | Assignee: | Go Community User |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Encountered in OSX and Linux but independent from any OS |
||
| Issue Links: |
|
||||||||
| Description |
|
if an ObjectID is part of a struct and this struct gets marshalled into json it gets converted into an array of integers, which is in line with the specification for json marshalling for an array of bytes. When the bytes are umnarshalled calling json.Unmarshal, however, the objectid.UnmarshalJSON method is called, which errors cause of the following lines: |
| Comments |
| Comment by Kristofer Brandow (Inactive) [ 11/Oct/18 ] |
|
Code Review: https://github.com/mongodb/mongo-go-driver/pull/97 and https://github.com/mongodb/mongo-go-driver/pull/98. |
| Comment by Githook User [ 11/Oct/18 ] |
|
Author: {'name': 'Kris Brandow', 'email': 'kris@mongodb.com', 'username': 'skriptble'}Message: Merge branches 'pr/97' and 'pr/98' Change-Id: If800aceefac70ad6deb98411a012c32f6a30fa0e |
| Comment by Delio D'Anna [ 28/Sep/18 ] |
|
Just a note, not a fix, it seems to work if you use a pointer to an ObjectID |