From f7cd775cd73d1edd39f0b182de5b2c776bb15172 Mon Sep 17 00:00:00 2001 From: Kevin Jump Date: Mon, 6 Jan 2025 12:02:12 +0000 Subject: [PATCH] #694 - fix handling of Strings when comparing json arrays in blockgrid. --- uSync.Core/Extensions/JsonTextExtensions.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/uSync.Core/Extensions/JsonTextExtensions.cs b/uSync.Core/Extensions/JsonTextExtensions.cs index 7c67b1f1..8f8a0412 100644 --- a/uSync.Core/Extensions/JsonTextExtensions.cs +++ b/uSync.Core/Extensions/JsonTextExtensions.cs @@ -1,6 +1,4 @@ -using Json.More; - -using System.Diagnostics.CodeAnalysis; +using System.Diagnostics.CodeAnalysis; using System.Text.Json; using System.Text.Json.Nodes; using System.Text.Json.Serialization; @@ -403,7 +401,14 @@ public static bool TryGetPropertyAsObject(this JsonObject jsonObject, string pro try { - result = propertyNode.AsObject(); + result = propertyNode.GetValueKind() switch + { + JsonValueKind.String => new JsonObject + { + { propertyName, propertyNode.ToString() } + }, + _ => propertyNode.AsObject(), + }; } catch {