-
Notifications
You must be signed in to change notification settings - Fork 1.3k
CSHARP-2096: Make EnumRepresentationConvention also affect collections of Enums #305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CSHARP-2096: Make EnumRepresentationConvention also affect collections of Enums #305
Conversation
e2b913d to
c329865
Compare
071aa0e to
122a69e
Compare
|
Any progress on getting this merged? |
|
Hi @narciero, |
|
@vincentkam, any updates on that? it was created in 2017! |
|
Just ran into this problem as well. You are at 4.4, any news on this issue? Please think about prioritising this. The fact that enums in a collection do not get serialized as strings, despite the |
|
We acknowledge that this PR has been sitting idle for a considerable amount of time and appreciate everyone's continued interest in these improvements to the MongoDB .NET Driver. We are investing in improvements to make serialization behaviour in the driver more intuitive and less error prone. This is an example where the driver does not behave as expected necessarily. If you enable the Rather than focusing on enums, let's consider the more general case of serialization conventions on collection types. The .NET Driver does not currently support the following either: What is the expected result? Should each item in the collection be serialized as a string or should the entire collection be serialized as a single comma-separated string? Another case to consider is that of Should both keys and values be serialized as strings? Should we add a The original problem of serializing collections of enums as their string representation can be solved either with a custom serializer on the containing type or for the enum itself. The other two mentioned cases can be solved similarly. We realize that this is not an ideal solution and we would like to provide better serialization semantics in the driver. We are reviewing serialization feature requests and bugs in an attempt to implement a more consistent and holistic approach to address problems such as this. We appreciate your patience and continued feedback on CSHARP-2096. |
|
I just ran in this problem today... 2024 |
The entire issue is documented here:
https://jira.mongodb.org/browse/CSHARP-2096
With this fix, the EnumRepresentationConvention should now work as expected.