Open ikourfaln opened 3 years ago
Thank you for this suggestion. We are working this into our roadmap, being tracked internally as DRV-531
Actually, it might be best if this is optional. You could use System.Text.Json
by default, but you should allow to configure Newtonsoft.Json
as an alternative. Microsoft's serializer has some issues, such as not supporting polymorphic deserialization (and limited serialization).
polymorphic serialization polymorphic deserialization
Also... this comment is not exactly accurate
and Newtonsoft.Json will be removed starting .NET 5.
While Microsoft's serializer is the default (for obvious reasons), one can still use Newtonsoft.Json
on ASP.NET projects. You just need to include the package Microsoft.AspNetCore.Mvc.NewtonsoftJson and when setting up the controllers on startup do this
services.AddControllers().AddNewtonsoftJson();
So... Newtonsoft's serializer isn't going anywhere just yet and much less while the polymorphic serialization issues prevail. And since that was a design decision, even less.
Hi,
Regarding JSON serializer, I see that
FaunaDB.Client
is usingNewtonsoft.Json
!! Check out theSystem.Text.Json
package, I highly recommend using it, it is Fast plus it's owned and maintained by Microsoft.Starting ASP.NET Core 3.1,
System.Text.Json
is the default JSON Serializer, andNewtonsoft.Json
will be removed starting .NET 5.