-
Notifications
You must be signed in to change notification settings - Fork 93
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
Migrate from Newtonsoft.Json
to System.Text.Json
#231
Comments
Hi @JamieMagee , I would like to take a stab at it, if this has not been picked up already.
just want to understand the reasoning behind this. I am assuming that
I saw some classes where
The only built-in property naming policy in System.Text.Json is for camel case |
Another thing to take into consideration (I tried this before -- maybe last year?) is maintaining the manifest output contract. If I remember correctly, there had to be some custom serializer implementations to make it line up. |
@tevoina thanks for the pointers @pn04 based on the info Teo shared someone from the Microsoft side will likely have to pick this item up. Thank you for volunteering though ❤️ |
For a long time
Newtonsoft.Json
was the best JSON library for .NET. However, sinceSystem.Text.Json
was added in .NET Core 3.0, it's clearly the future. It's a core part of .NET, so there's no need for an additional dependency, and it's far more performant thanNewtonsoft.Json
A couple of things to be aware of:
JsonPropertName
attributes to object properties?exampleVariableName
) over PascalCase (ExampleVariableName
)?Newtonsoft.Json
can accept both by default, canSystem.Text.Json
too?SerializeAsync
DeserializeAsync
References:
Newtonsoft.Json
toSystem.Text.Json
migration guideSystem.Text.Json
The text was updated successfully, but these errors were encountered: