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
|
try
|
||||||
{
|
{
|
||||||
string json = JsonSerializer.Serialize(report, new JsonSerializerOptions()
|
string json = JsonSerializer.Serialize(report, typeof(DeviceReport), DeviceReportContext.Default);
|
||||||
{
|
|
||||||
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
|
|
||||||
WriteIndented = true
|
|
||||||
});
|
|
||||||
|
|
||||||
var httpClient = new HttpClient();
|
var httpClient = new HttpClient();
|
||||||
|
|
||||||
|
|||||||
@@ -1576,11 +1576,7 @@ sealed class DeviceReportCommand : Command
|
|||||||
|
|
||||||
var jsonFs = new FileStream(jsonFile, FileMode.Create);
|
var jsonFs = new FileStream(jsonFile, FileMode.Create);
|
||||||
|
|
||||||
JsonSerializer.Serialize(jsonFs, report, new JsonSerializerOptions()
|
JsonSerializer.Serialize(jsonFs, report, typeof(DeviceReport), DeviceReportContext.Default);
|
||||||
{
|
|
||||||
WriteIndented = true,
|
|
||||||
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
|
|
||||||
});
|
|
||||||
|
|
||||||
jsonFs.Close();
|
jsonFs.Close();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user