Skip to content

Commit

Permalink
#694 - fix handling of Strings when comparing json arrays in blockgrid.
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinJump committed Jan 6, 2025
1 parent 6be5749 commit f7cd775
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions uSync.Core/Extensions/JsonTextExtensions.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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
{
Expand Down

0 comments on commit f7cd775

Please sign in to comment.