diff options
| author | JP Dillingham <jp@dillingham.me> | 2026-02-16 14:03:56 -0600 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2026-02-16 14:03:56 -0600 |
| commit | 5ac69d7fe558d75c0b887605f83b678ed0c10854 (patch) | |
| tree | 59ee4a41ceae9bc82e50ef1bc25756f10b72f71a /src/slskd/Events/Types | |
| parent | 183645f2e1d99c8e5ef1334ade9acfe399f82be1 (diff) | |
| download | slskd-5ac69d7fe558d75c0b887605f83b678ed0c10854.tar.gz | |
add KnownUnsupportedTypeConverter to prevent crashes when serializing some types
Diffstat (limited to 'src/slskd/Events/Types')
| -rw-r--r-- | src/slskd/Events/Types/EventRecord.cs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/slskd/Events/Types/EventRecord.cs b/src/slskd/Events/Types/EventRecord.cs index 4323a42b..685a090c 100644 --- a/src/slskd/Events/Types/EventRecord.cs +++ b/src/slskd/Events/Types/EventRecord.cs @@ -38,10 +38,16 @@ public record EventRecord private static JsonSerializerOptions JsonSerializerOptions { get; } = new JsonSerializerOptions() { PropertyNameCaseInsensitive = true, - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, + DefaultIgnoreCondition = JsonIgnoreCondition.Never, PropertyNamingPolicy = JsonNamingPolicy.CamelCase, Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping, WriteIndented = false, + Converters = + { + new IPAddressConverter(), + new JsonStringEnumConverter(), + new KnownUnsupportedTypeConverter(), + }, }; /// <summary> |
