Let's say at first I have a record with only one parameter "int no". Later, as the program evolves, new param with a default value is added resulting:
record SimpleRecord(int no, string paramStr = "New param that did not existed");
now parsing previously saved json with two different libs:
string jsonText = "{\"no\":10}";
SimpleRecord? parsedJson1 = System.Text.Json.JsonSerializer.Deserialize<SimpleRecord>(jsonText);
SimpleRecord? parsedJson2 = Newtonsoft.Json.JsonConvert.DeserializeObject<SimpleRecord>(jsonText);
I would expect parsed record as System.Text.Json -> {SimpleRecord { no = 10, paramStr = New param that did not existed }} Newton parsed record is {SimpleRecord { no = 10, paramStr = }}
paramStr is null. How to achieve the same result as System.Text.Json with Newton library? (I have existing project with Newton so trying to avoid rewriting).