build
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Nodes;
|
||||
using System.Text.Json.Nodes;
|
||||
using Json.Patch;
|
||||
using Umbraco.Cms.Api.Management.Serialization;
|
||||
using Umbraco.Cms.Api.Management.ViewModels.JsonPatch;
|
||||
@@ -20,8 +18,7 @@ public class JsonPatchService : IJsonPatchService
|
||||
|
||||
var docString = _jsonSerializer.Serialize(objectToPatch);
|
||||
JsonPatch? patch = _jsonSerializer.Deserialize<JsonPatch>(patchString);
|
||||
var reader = new Utf8JsonReader(Encoding.UTF8.GetBytes(docString));
|
||||
var element = JsonElement.ParseValue(ref reader);
|
||||
return patch?.Apply(element);
|
||||
var doc = JsonNode.Parse(docString);
|
||||
return patch?.Apply(doc);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user