[CSHARP-1385] Unable to explicitly set serializer for recursive enumerable types Created: 23/Aug/15 Updated: 02/Apr/16 Resolved: 28/Jan/16 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Serialization |
| Affects Version/s: | 2.0 |
| Fix Version/s: | 2.1 |
| Type: | Bug | Priority: | Critical - P2 |
| Reporter: | David Pfeffer | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
|
The following Main function will blow up, due to the constructor for ArraySerializer registering a class map for the type before the class map can be registered.
|
| Comments |
| Comment by Robert Stam [ 28/Jan/16 ] |
|
I have verified that the fix to |
| Comment by Robert Stam [ 24/Aug/15 ] |
|
Agreed. It should be lazy, and the change made for |
| Comment by David Pfeffer [ 24/Aug/15 ] |
|
IMO the default behavior should be lazy. This caused a pretty major breaking change sort of bug when I just tried to migrate to 2.0 from 1.x. I had to write my own serializer to avoid it. This current bug/design decision is nonobvious until you dig into the source. |
| Comment by Robert Stam [ 24/Aug/15 ] |
|
This seems to be related to There is a new constructor for ArraySerializer<T> that enables delaying the choosing of the serializer for <T> by passing in a serializerRegistry: |