Skip to content

Commit

Permalink
✍️ Json serialization: ignore read-only properties
Browse files Browse the repository at this point in the history
This change was made to ignore properties inherited from `ReactiveObject`, which has annotations that opt out of serialization for public properties. But System.Text.Json doesn't support these annotations (ref dotnet/runtime#29975).
  • Loading branch information
database64128 committed May 11, 2021
1 parent 3837bd0 commit e12042b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions YoutubeDl.Wpf/Utils/FileHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public static class FileHelper
public static readonly JsonSerializerOptions commonJsonSerializerOptions = new()
{
Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping,
IgnoreReadOnlyProperties = true,
WriteIndented = true,
};

Expand Down

0 comments on commit e12042b

Please sign in to comment.