mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Use source generator for device report JSON serializing.
This commit is contained in:
Submodule Aaru.CommonTypes updated: 29c1776fab...177683a255
@@ -68,11 +68,7 @@ public static class Remote
|
||||
|
||||
try
|
||||
{
|
||||
string json = JsonSerializer.Serialize(report, new JsonSerializerOptions()
|
||||
{
|
||||
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
|
||||
WriteIndented = true
|
||||
});
|
||||
string json = JsonSerializer.Serialize(report, typeof(DeviceReport), DeviceReportContext.Default);
|
||||
|
||||
var httpClient = new HttpClient();
|
||||
|
||||
|
||||
@@ -1576,11 +1576,7 @@ sealed class DeviceReportCommand : Command
|
||||
|
||||
var jsonFs = new FileStream(jsonFile, FileMode.Create);
|
||||
|
||||
JsonSerializer.Serialize(jsonFs, report, new JsonSerializerOptions()
|
||||
{
|
||||
WriteIndented = true,
|
||||
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
|
||||
});
|
||||
JsonSerializer.Serialize(jsonFs, report, typeof(DeviceReport), DeviceReportContext.Default);
|
||||
|
||||
jsonFs.Close();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user