[CSHARP-4511] Allow specifying different AllowedTypes filter for serialization/deserialization Created: 01/Feb/23 Updated: 24/Mar/23 Resolved: 23/Feb/23 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 2.19.1 |
| Type: | Improvement | Priority: | Unknown |
| Reporter: | Nikola Irinchev | Assignee: | Robert Stam |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Documentation Changes: | Not Needed | ||||
| Documentation Changes Summary: | 1. What would you like to communicate to the user about this feature? |
||||
| Description |
|
Example API affected by this change are:
As can be seen in those examples, the arguments we're accepting are untyped objects, which we serialize to json using ObjectSerializer and we're returning objects of a concrete type, which would typically use a different serializer type. (the reason we're using untyped API for a lot of these MongoDB operations is to allow developers the flexibility of using BsonDocument, their own POCOs representing filters/projections, or even anonymous objects - I realize this is a departure from the API exposed by the C# driver) Decoupling the serialization from deserialization filters gives us the flexibility to accept wide range of inputs, while still protecting users from accidentally deserializing unsafe types. |
| Comments |
| Comment by Githook User [ 24/Mar/23 ] |
|
Author: {'name': 'rstam', 'email': 'robert@robertstam.org', 'username': 'rstam'}Message: |
| Comment by Githook User [ 23/Feb/23 ] |
|
Author: {'name': 'rstam', 'email': 'robert@robertstam.org', 'username': 'rstam'}Message: |