mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Use source generator for Aaru Metadata JSON serializing.
This commit is contained in:
@@ -45,6 +45,7 @@
|
||||
<PackageReference Include="Macross.Json.Extensions" Version="3.0.0"/>
|
||||
<PackageReference Include="System.ComponentModel.Annotations" Version="6.0.0-preview.4.21253.7"/>
|
||||
<PackageReference Include="System.Security.Principal.Windows" Version="6.0.0-preview.5.21301.5"/>
|
||||
<PackageReference Include="System.Text.Json" Version="7.0.0"/>
|
||||
<PackageReference Include="System.ValueTuple" Version="4.5.0"/>
|
||||
<PackageReference Include="Unclassified.NetRevisionTask" Version="0.4.3" PrivateAssets="all"/>
|
||||
</ItemGroup>
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
using Schemas;
|
||||
|
||||
// ReSharper disable UnusedMember.Global
|
||||
@@ -45,6 +46,10 @@ using Schemas;
|
||||
|
||||
namespace Aaru.CommonTypes.AaruMetadata;
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true, DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
[JsonSerializable(typeof(MetadataJson))]
|
||||
public partial class MetadataJsonContext : JsonSerializerContext {}
|
||||
|
||||
public class MetadataJson
|
||||
{
|
||||
public Metadata AaruMetadata { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user