-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Consider Keeping Newtonsoft.JSON as an Optional Package Or Otherwise refactoring Nuget Packaging #1278
Comments
That might be an option, but please define many organisations and what is the source of your data. Also, quite a lot of Microsoft own packages have a dependency on Newtonsoft.Json, so I don't really see this as an issue. My problem, as the maintainer, is that we have tons of issues with JSON serialisation and I don't want to start fixing SimpleJson. |
'Many' was admittedly a point without a lot of solid data to back it up. I can state that at both the current org I am at, as well as the previous, we used RestSharp either with the default SimpleJson, or with another Serializer. And a driving point towards RestSharp in both cases was that it did not force us to take a dependency on Newtonsoft. In one case it was primarily convenience (Minimizing Assembly Redirect concerns.) The other case was due to the version of MassTransit in use. I can certainly empathize with JSON Serialization Issues. Ironically I ran into one with RestSharp+SimpleJson just after writing this issue. |
Actually, being the MassTransit organization member, I always considered it as one of the examples where the dependency on Newtonsoft.Json was never an issue. The MT repository has exactly ZERO issues about serialisation and we have like 40% of them, which is very frustrating. I could consider having a RestSharp.Core library that has no default serialisation and RestSharp that would depend on both the Core and Newtonsoft.Json. |
Although, the name Core will be confusing, since people will definitely think that it is the version, which supports .NET Core. I believe, even the package name is used by someone. |
So, I'll be the first to admit this is a chain of issues that lead to the problem in question; The version of MassTransit in use is/was 2.9.0. At some point after Newtonsoft Version 6.0.6, This means if you upgrade Newtonsoft.JSON past a certain version, You'll have runtime exceptions in the MassTransit v2 But aside from that older example, there have been other issues in projects such as NEST, RawRabbit, Hangfire, and even Windows XAML. While Newtonsoft is an amazingly useful and robust Json Parser, The end result of such wide adoption is that the end library consumers have to juggle versions of both Newtonsoft and the Newtonsoft consuming libraries. |
Well, I see your issue. But, if you decided to keep MT 2.9, when the latest is 5.3.1, why can't you also keep RestSharp 106? |
I know that .NET Core 3 will have its own JSON serializer. Maybe we just need to wait for it? |
Yeah, it seems like we will keep all serializers outside and RestSharp will still be with zero dependencies. Serializers would need to come in separate packages but everything will live in one repo. |
Here is the template message concerning JSON serialization. We are closing tickets that concern issues with JSON serialization after the 106.10.0 release, which includes new packages to support serialization using Most certainly, your issue will be resolved by using one of those serializers. Don't forget to check the serialization options, which can affect the ability to deserialize your request on the server-side or deserialize the response. Please refer to the updated documentation about serialization. |
One of the reasons many organizations have adopted RestSharp is because it is a lightweight library that doesn't have hard dependencies on things like Newtonsoft.JSON.
If you must have Newtonsoft as part of the 'standard' install, Please consider splitting the nuget packaging up such that people are not forced to take it as a dependency i.e. the
Restsharp
package consists ofRestsharp.Core
(no built-in-serializer, or SimpleJson) andRestsharp.Serializers.Newtonsoft
.The text was updated successfully, but these errors were encountered: