This commit is contained in:
master
2026-02-04 19:59:20 +02:00
parent 557feefdc3
commit 5548cf83bf
1479 changed files with 53557 additions and 40339 deletions

View File

@@ -14,7 +14,7 @@ namespace StellaOps.AirGap.Bundle.Serialization;
/// </summary>
public static class BundleManifestSerializer
{
private static readonly JsonSerializerOptions JsonOptions = new(JsonSerializerDefaults.Web)
private static readonly JsonSerializerOptions _jsonOptions = new(JsonSerializerDefaults.Web)
{
WriteIndented = false,
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
@@ -28,14 +28,14 @@ public static class BundleManifestSerializer
public static string Serialize(BundleManifest manifest)
{
var jsonBytes = JsonSerializer.SerializeToUtf8Bytes(manifest, JsonOptions);
var jsonBytes = JsonSerializer.SerializeToUtf8Bytes(manifest, _jsonOptions);
var canonicalBytes = CanonJson.CanonicalizeParsedJson(jsonBytes);
return Encoding.UTF8.GetString(canonicalBytes);
}
public static BundleManifest Deserialize(string json)
{
return JsonSerializer.Deserialize<BundleManifest>(json, JsonOptions)
return JsonSerializer.Deserialize<BundleManifest>(json, _jsonOptions)
?? throw new InvalidOperationException("Failed to deserialize bundle manifest");
}