[CSHARP-265] Serialization of Dictionary<string, T> fails if any key is not a valid element name Created: 08/Jul/11 Updated: 02/Apr/15 Resolved: 13/Jul/11 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | 1.1 |
| Fix Version/s: | 1.2 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Robert Stam | Assignee: | Robert Stam |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
To reproduce: public class C { var c = new C { Data = new Dictionary<string, int> { { "a.b", 1 } } }; |
| Comments |
| Comment by Robert Stam [ 13/Jul/11 ] |
|
DictionarySerializer and DictionaryGenericSerializer now switch to the alternate array representation when any key value is not a valid element name. The client code can also force use of Array or Document representation using serialization options (perhaps for efficiency reasons to skip scanning the keys for validity as element names). |