mirror of
https://github.com/aaru-dps/Aaru.CommonTypes.git
synced 2025-12-16 19:24:30 +00:00
Use source generator for statistics upload JSON serializing.
This commit is contained in:
@@ -41,6 +41,7 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace Aaru.CommonTypes.Metadata;
|
||||
@@ -83,6 +84,12 @@ public class Stats
|
||||
public VerifyStats Verify { get; set; }
|
||||
}
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true, DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
|
||||
IncludeFields = true)]
|
||||
[JsonSerializable(typeof(StatsDto))]
|
||||
// ReSharper disable once PartialTypeWithSinglePart
|
||||
public partial class StatsDtoContext : JsonSerializerContext {}
|
||||
|
||||
/// <summary>DTO for statistics</summary>
|
||||
[SuppressMessage("ReSharper", "CollectionNeverQueried.Global")]
|
||||
public class StatsDto
|
||||
|
||||
Reference in New Issue
Block a user