This feedback is written regarding the documentation at https://docs.microsoft.com/en-us/aspnet/core/web-api/jsonpatch?view=aspnetcore-3.1#jsonpatch-in-aspnet-core in the linked section "JsonPatch in ASP.NET Core".
The section indicates that the ASP.NET Core implementation of JSON Patch is provided in the Microsoft.AspNetCore.JsonPatch NuGet package and then cites an example that passes ModelState in as an argument to the ApplyTomethod on a JsonPatchDocument<T>. This method overload does not exist within the installed library as seen in the below source:
Rather, it's an extension method available within the Microsoft.AspNetCore.Mvc.NewtonsoftJson package:
https://github.com/aspnet/AspNetCore/blob/c759f5b8f82fc0ed1a5e918c6b611ffb861af84d/src/Mvc/Mvc.NewtonsoftJson/src/JsonPatchExtensions.cs#L21
This specific example should likely be replaced with one that uses only the native implementation (for the time being in the current release) and this example should be moved into another sub-section of this portion of the document that describes both installing this other package to use its extension method for validation purposes.
I'll be submitting an issue in the relevant Github repo to move this extension into the JsonPatchDocument package itself.
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
@WhitWaldo see https://github.com/aspnet/AspNetCore.Docs/pull/16824
cc @kkbruce
This section https://docs.microsoft.com/en-us/aspnet/core/web-api/jsonpatch?view=aspnetcore-3.1#jsonpatch-in-aspnet-core is written not good. I also tried it for a long time to implement it. That's why I want to submit new JsonPatch example PR.
In ASP.NET Core 3.1, JsonPatch is still needed NewtonsoftJson to support operations.
Waiting for PR review and merge, you can access my jsonpatch sample version:
https://github.com/kkbruce/AspNetCore.Docs/tree/master/aspnetcore/web-api/jsonpatch/samples/3.1
@kkbruce what's the status of this issue?
Tracked in JsonPatch Master issue. Look here #18330
Most helpful comment
This section https://docs.microsoft.com/en-us/aspnet/core/web-api/jsonpatch?view=aspnetcore-3.1#jsonpatch-in-aspnet-core is written not good. I also tried it for a long time to implement it. That's why I want to submit new JsonPatch example PR.
In ASP.NET Core 3.1, JsonPatch is still needed NewtonsoftJson to support operations.