To use a custom JSON property naming policy create a class that derives from JsonNamingPolicy and override the ConvertName method as shown in the following example.
How to use newtonsoft instead of system.text.json. Tests in SentryProtocol would first need to pass using SystemTextJson. This article shows how to use the SystemTextJson namespace to serialize to and deserialize from JavaScript Object Notation JSON. Tacking on AddNewtonsoftJson to the end means it will revert back to using Newtonsoft over SystemTextJson.
AppCenter uses NewtonsoftJson to handle the JSON serialization at the moment. Should it only affect target netcoreapp30. This article explains how to avoid performance problems when you use JsonSerializerOptions.
JsonDocument provides the ability to build a read-only DOM by using Utf8JsonReader. SystemTextJson provides two ways to build a JSON DOM. All of the methods to write the property to output are by type ie.
Adoption of SystemTextJson is encouraged for applications targetingNET Core 3. I read the article and it is faster than NewtonsoftJson. Namespace SystemTextJsonSamples public class UpperCaseNamingPolicy.
As long as our projects IMvcBuilder is being intialized including that call every time well call the Json method from our apps action methods the NewtonsoftJson API will be used under the hood. This article shows how to migrate from NewtonsoftJson to SystemTextJson. Should change be done to all targets and publish as part of 20.
The JsonElement type provides array and object enumerators along with APIs to convert JSON text to common NET types. The only issue is that you have to write everything to the writer manually. If this is an API you will likely have AddControllers but depending on your project setup you could have the others also.