I’ve pushed a new version of JsonPatch for .NET to NuGet. If you’re already using it, a simple update from the NuGet dialog will do.
This new version includes a bunch of bug changes, but the most notable addition is support for deeply nested objects. JsonPatch now allows you to patch properties that are in nested objects, or in-between nested objects / object trees.
This allows scenarios as such:
// replace StringProperty in nested object patchDoc.Replace<string>(o => o.NestedObject.StringProperty, "B"); // copy StringProperty value from root to nested object patchDoc.Copy<string>(o => o.StringProperty, o => o.NestedObject.StringProperty); // Move integer value from array in nested object (position 0) to IntegerProperty at root patchDoc.Move<int>(o => o.NestedObject.IntegerList, 0, o => o.IntegerProperty);
You can find the new version at NuGet, and you’re always free to look into the source code, log issues or contribute at my GitHub repository.
Happy coding! 🙂