Setting the JsonConvert.DefaultSettings
did the trick.
JsonConvert.DefaultSettings = () => new JsonSerializerSettings
{
Formatting = Formatting.Indented,
TypeNameHandling = TypeNameHandling.Objects,
ContractResolver = new CamelCasePropertyNamesContractResolver()
};
More Related Contents:
- How to write a JSON file in C#?
- What is the difference between PreserveReferencesHandling and ReferenceLoopHandling in Json.Net?
- JSON serialize properties on class inheriting list [duplicate]
- JSON Deserialization – String Is Automatically Converted To Int
- Is there a way in Json.NET serialization to distinguish between “null because not present” and “null because null”?
- Cannot deserialize the JSON array (e.g. [1,2,3]) into type ‘ ‘ because type requires JSON object (e.g. {“name”:”value”}) to deserialize correctly
- Detect if deserialized object is missing a field with the JsonConvert class in Json.NET
- How can I deserialize a child object with dynamic (numeric) key names?
- Deserializing JSON when sometimes array and sometimes object
- Cannot deserialize the current JSON object (e.g. {“name”:”value”}) into type ‘System.Collections.Generic.List`1
- How to ignore JsonProperty(PropertyName = “someName”) when serializing json?
- Deserializing JSON when key values are unknown
- JSON.NET Parser *seems* to be double serializing my objects
- Deserializing dates with dd/MM/yyyy format using Json.Net
- Deserializing JSON with unknown object names
- How to convert datatable to json string using json.net?
- How do I convert an escaped JSON string within a JSON object?
- Serialize a container of enums as strings using JSON.net
- Handling decimal values in Newtonsoft.Json
- How to convert Json array to list of objects in c#
- Newtonsoft.Json SerializeObject without escape backslashes
- Custom json serialization for each item in IEnumerable [duplicate]
- How do I get a deeply-nested property from JSON string?
- How to return JSon object
- Is there a way to ignore get-only properties in Json.NET without using JsonIgnore attributes?
- Best ways to split a string with matching curly braces
- How do I get formatted and indented JSON in .NET using C#?
- How to deserialize a property with a dash (“-”) in its name with NewtonSoft JsonConvert?
- Serializing/Deserializing Dictionary of objects with JSON.NET
- Generate JSON object with NewtonSoft in a single line