Closed yufeih closed 2 weeks ago
These diffs are caused by changing JSON serialize from NewtonsoftJson to System.Text.Json
.
var value = 1.0d;
Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(value)); // Output: `1`
Console.WriteLine(Newtonsoft.Json.JsonConvert.SerializeObject(value)); // Output: `1.0`
Both result are correct JSON representation.
Though it might be better to serialize as 1.0
. (by adding custom JSON converter)
Because when JSON deserialized as Dictionary<string, object>
.
Deserialized value type is inferred based on number representation.
I understand where the diff is coming from, what I'm trying to figure out is why these diffs didn't fail the PRs that introduced them.
As comment at #10156
Currently CI don't validate snapshot files because SNAPSHOT_TEST
is not set.
Snapshot testing seems broken