[CSHARP-1868] Deserialize discriminated data to ExpandoObject Created: 15/Dec/16 Updated: 27/Oct/23 Resolved: 04/Jan/21 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Serialization |
| Affects Version/s: | 2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Anatoliy Rabchevskiy | Assignee: | Unassigned |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
I'm trying to deserialize entire document that contains polymorphic collection to dynamic object. Example data: , { \"_t\" : \"Square\", \"Side\" : 3 }] }"; Current behavior: Expected: |
| Comments |
| Comment by Boris Dogadov [ 04/Jan/21 ] |
|
Hi anatoliy.rabchevskiy, thank you for your PR. Deserializing the discriminated type as a concrete type would be the expected behaviour in most use-cases. Changing this behavior would be a breaking change. However this default behavior can be overridden by a custom serializer. |