From 39bf7fe9b9362e57c648d3b5fc4d680f8fcc2a51 Mon Sep 17 00:00:00 2001 From: Jkorf Date: Wed, 6 Nov 2024 11:20:37 +0100 Subject: [PATCH] Added support for object deserialization in SystemTextJsonMessageAccessor.GetValue --- .../SystemTextJson/SystemTextJsonMessageAccessor.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CryptoExchange.Net/Converters/SystemTextJson/SystemTextJsonMessageAccessor.cs b/CryptoExchange.Net/Converters/SystemTextJson/SystemTextJsonMessageAccessor.cs index 9c3ba7f..5e57192 100644 --- a/CryptoExchange.Net/Converters/SystemTextJson/SystemTextJsonMessageAccessor.cs +++ b/CryptoExchange.Net/Converters/SystemTextJson/SystemTextJsonMessageAccessor.cs @@ -126,7 +126,14 @@ namespace CryptoExchange.Net.Converters.SystemTextJson return default; if (value.Value.ValueKind == JsonValueKind.Object || value.Value.ValueKind == JsonValueKind.Array) + { + try + { + return value.Value.Deserialize(_serializerOptions); + } + catch { } return default; + } if (typeof(T) == typeof(string)) {