Is there some way to set what the default representation for null values should be in Json.NET? More specifically null values inside an array.
Given the class
public class Test
{
public object[] data = new object[3] { 1, null, "a" };
}
Then doing this
Test t = new Test();
string json = JsonConvert.SerializeObject(t);
Gives
{"data":[1,null,"a"]}
Is it possible to make it look like this?
{"data":[1,,"a"]}
Without using string.Replace.
{"data":[1,,"a"]}is not a valid json.{"data":[1,0,"a"]}be valid Json?JSON.parseon your browser console and get a guaranteed correct answer directly.