-
Notifications
You must be signed in to change notification settings - Fork 41
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
Built-in JSON serialization without reflection #221
Comments
We're making this issue visible after some issues caused by custom serializers, but it's not gonna be prioritized soon. We'd like to collect some feedback from the community (you), and why not some contribution. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Why not opting for System.Text.Json rather than still using the Newtonsoft implementation? Not sure how backwards compatible this is though since it's been a long time now that I used .NET framework. |
Yeah I think this makes sense. Backwards compatibility should be okay |
Handled by #249 |
This should be out in the next major release |
Is your feature request related to a problem? Please describe.
Depending on a Json serialization library that requires a custom implementation, can lead to errors. In particular, when defining a custom serialization with system.text if we forget to do
stream.Position = 0;
the payload will not be serialized properly, leading to errors downstream.Describe the solution you'd like
Serialization should be provided by the SDK, it's not something users should override, as there's only 1 correct way of serializing the payload. The downside is that the actual users, that are using a custom serializer might cause a crash at runtime.
Describe alternatives you've considered
None, but open to suggestions
Additional context
As a sample test, I wrote a test for System.text as serializer. It's currently not working because the test compares strings to strings and the only difference is the sort order of fields. So it's the test that needs to change. On top of that, the test is not covering serialization of metrics, so it's incomplete. But it's a good enough to prove the point that serialization is dangerous if left in the hands of users and it should be handled by the SDK without giving users the ability to override it:
https://github.com/Unleash/unleash-client-dotnet/compare/system-text-serialization-test?expand=1
The text was updated successfully, but these errors were encountered: