Microsoft.AspNetCore.JsonPatch 10.0.0-preview.3.25172.1
About
Microsoft.AspNetCore.JsonPatch provides ASP.NET Core support for JSON PATCH requests.
How to Use
To use Microsoft.AspNetCore.JsonPatch, follow these steps:
Installation
dotnet add package Microsoft.AspNetCore.JsonPatch
dotnet add package Microsoft.AspNetCore.Mvc.NewtonsoftJson
Configuration
To enable JSON Patch support, call AddNewtonsoftJson in your ASP.NET Core app's Program.cs:
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddControllers()
.AddNewtonsoftJson();
Configure when using System.Text.Json
To add support for JSON Patch using Newtonsoft.Json while continuing to use System.Text.Json for other input and output formatters:
- Update your
Program.cswith logic to construct aNewtonsoftJsonPatchInputFormatter:static NewtonsoftJsonPatchInputFormatter GetJsonPatchInputFormatter() { var builder = new ServiceCollection() .AddLogging() .AddMvc() .AddNewtonsoftJson() .Services.BuildServiceProvider(); return builder .GetRequiredService<IOptions<MvcOptions>>() .Value .InputFormatters .OfType<NewtonsoftJsonPatchInputFormatter>() .First(); } - Configure the input formatter:
var builder = WebApplication.CreateBuilder(args); builder.Services.AddControllers(options => { options.InputFormatters.Insert(0, GetJsonPatchInputFormatter()); });
Usage
To define an action method for a JSON Patch in an API controller:
- Annotate it with the
HttpPatchattribute - Accept a
JsonPatchDocument<TModel> - Call
ApplyToon the patch document to apply changes
For example:
[HttpPatch]
public IActionResult JsonPatchWithModelState(
[FromBody] JsonPatchDocument<Customer> patchDoc)
{
if (patchDoc is not null)
{
var customer = CreateCustomer();
patchDoc.ApplyTo(customer, ModelState);
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
return new ObjectResult(customer);
}
else
{
return BadRequest(ModelState);
}
}
In a real app, the code would retrieve the data from a store such as a database and update the database after applying the patch.
Additional Documentation
For additional documentation and examples, refer to the official documentation on JSON Patch in ASP.NET Core.
Feedback & Contributing
Microsoft.AspNetCore.JsonPatch is released as open-source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.
Showing the top 20 packages that depend on Microsoft.AspNetCore.JsonPatch.
| Packages | Downloads |
|---|---|
|
Microsoft.AspNetCore.Mvc.NewtonsoftJson
ASP.NET Core MVC features that use Newtonsoft.Json. Includes input and output formatters for JSON and JSON PATCH.
This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/2f1db20456007c9515068a35a65afdf99af70bc6
|
56 |
|
Microsoft.AspNetCore.Mvc.NewtonsoftJson
ASP.NET Core MVC features that use Newtonsoft.Json. Includes input and output formatters for JSON and JSON PATCH.
This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/954f61dd38b33caa2b736c73530bd5a294174437
|
13 |
|
Microsoft.AspNetCore.Mvc.NewtonsoftJson
ASP.NET Core MVC features that use Newtonsoft.Json. Includes input and output formatters for JSON and JSON PATCH.
This package was built from the source code at https://github.com/dotnet/dotnet/tree/75972a5ba730bdaf7cf3a34f528ab0f5c7f05183
|
6 |
|
Microsoft.AspNetCore.Mvc.NewtonsoftJson
ASP.NET Core MVC features that use Newtonsoft.Json. Includes input and output formatters for JSON and JSON PATCH.
This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/d504a7b7dab277712646747e9f5cce0d9507245e
|
6 |
|
Microsoft.AspNetCore.Mvc.NewtonsoftJson
ASP.NET Core MVC features that use Newtonsoft.Json. Includes input and output formatters for JSON and JSON PATCH.
This package was built from the source code at https://github.com/aspnet/AspNetCore/tree/458d97420a173fe87487b58ec4aa47a4c9dc4710
|
6 |
|
Microsoft.AspNetCore.Mvc.NewtonsoftJson
ASP.NET Core MVC features that use Newtonsoft.Json. Includes input and output formatters for JSON and JSON PATCH.
This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/6a01dd1e69c8b9bd1ae005ea465ef2bcd26294bf
|
6 |
|
Microsoft.AspNetCore.Mvc.NewtonsoftJson
ASP.NET Core MVC features that use Newtonsoft.Json. Includes input and output formatters for JSON and JSON PATCH.
This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/e77cb01b5529c137130757859f09f892dbdd2436
|
6 |
|
Microsoft.AspNetCore.Mvc.NewtonsoftJson
ASP.NET Core MVC features that use Newtonsoft.Json. Includes input and output formatters for JSON and JSON PATCH.
This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/c2a442982e736e17ae6bcadbfd8ccba278ee1be6
|
5 |
|
Microsoft.AspNetCore.Mvc.NewtonsoftJson
ASP.NET Core MVC features that use Newtonsoft.Json. Includes input and output formatters for JSON and JSON PATCH.
This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/71dd6b0c87d7619668a40876d084d93db57eab41
|
5 |
|
Microsoft.AspNetCore.Mvc.NewtonsoftJson
ASP.NET Core MVC features that use Newtonsoft.Json. Includes input and output formatters for JSON and JSON PATCH.
This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/5ae8106f83d4d23cd0a2d2474c1b15e4d5dfc9eb
|
5 |
|
Microsoft.AspNetCore.Mvc.NewtonsoftJson
ASP.NET Core MVC features that use Newtonsoft.Json. Includes input and output formatters for JSON and JSON PATCH.
This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/979632683c720152cc04d0684644c40512f4e953
|
5 |
|
Microsoft.AspNetCore.Mvc.NewtonsoftJson
ASP.NET Core MVC features that use Newtonsoft.Json. Includes input and output formatters for JSON and JSON PATCH.
This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/f6cb1b5953598e1562d33e1cbbdae2b130792833
|
5 |
|
Microsoft.AspNetCore.Mvc.NewtonsoftJson
ASP.NET Core MVC features that use Newtonsoft.Json. Includes input and output formatters for JSON and JSON PATCH.
This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/e0d900c8649d185cf925b59bc12187a116e5e114
|
5 |
|
Microsoft.AspNetCore.Mvc.NewtonsoftJson
ASP.NET Core MVC features that use Newtonsoft.Json. Includes input and output formatters for JSON and JSON PATCH.
This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/32e8c8cae5b1a4dd752d0a42a6f8a2813f75f173
|
5 |
|
Microsoft.AspNetCore.Mvc.NewtonsoftJson
ASP.NET Core MVC features that use Newtonsoft.Json. Includes input and output formatters for JSON and JSON PATCH.
This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/704f7cb1d2cea33afb00c2097731216f121c2c73
|
5 |
|
Microsoft.AspNetCore.Mvc.NewtonsoftJson
ASP.NET Core MVC features that use Newtonsoft.Json. Includes input and output formatters for JSON and JSON PATCH.
This package was built from the source code at https://github.com/aspnet/AspNetCore/tree/49e84ee5ff04b17f35cacb9c1d6ccf52d8328dad
|
5 |
|
Microsoft.AspNetCore.Mvc.NewtonsoftJson
ASP.NET Core MVC features that use Newtonsoft.Json. Includes input and output formatters for JSON and JSON PATCH.
This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/f6b3a5da75eb405046889a5447ec9b14cc29d285
|
5 |
|
Microsoft.AspNetCore.Mvc.NewtonsoftJson
ASP.NET Core MVC features that use Newtonsoft.Json. Includes input and output formatters for JSON and JSON PATCH.
This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/cea5fa610dba4e0c024727f4c528a66018b820a3
|
5 |
|
Microsoft.AspNetCore.Mvc.NewtonsoftJson
ASP.NET Core MVC features that use Newtonsoft.Json. Includes input and output formatters for JSON and JSON PATCH.
This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/b96167fbfe8bd45d94e4dcda42c7d09eb5745459
|
4 |
|
Microsoft.AspNetCore.Mvc.NewtonsoftJson
ASP.NET Core MVC features that use Newtonsoft.Json. Includes input and output formatters for JSON and JSON PATCH.
This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/d5dc8a13cc618b9cbdc1e5744b4806c594d49553
|
4 |
.NET Framework 4.6.2
- Microsoft.CSharp (>= 4.7.0)
- Newtonsoft.Json (>= 13.0.3)
.NET 10.0
- Newtonsoft.Json (>= 13.0.3)
.NET Standard 2.0
- Microsoft.CSharp (>= 4.7.0)
- Newtonsoft.Json (>= 13.0.3)
| Version | Downloads | Last updated |
|---|---|---|
| 10.0.0-preview.3.25172.1 | 6 | 07/11/2025 |
| 9.0.4 | 5 | 07/13/2025 |
| 9.0.0-preview.6.24328.4 | 5 | 07/09/2025 |
| 8.0.19 | 6 | 08/08/2025 |
| 8.0.11 | 5 | 07/09/2025 |
| 8.0.10 | 5 | 07/12/2025 |
| 8.0.8 | 13 | 08/02/2025 |
| 8.0.7 | 53 | 07/07/2025 |
| 8.0.3 | 4 | 07/12/2025 |
| 8.0.2 | 4 | 07/13/2025 |
| 8.0.0-rc.1.23421.29 | 6 | 07/12/2025 |
| 8.0.0-preview.7.23375.9 | 6 | 07/11/2025 |
| 8.0.0-preview.5.23302.2 | 6 | 07/11/2025 |
| 7.0.16 | 6 | 07/10/2025 |
| 7.0.4 | 4 | 07/11/2025 |
| 7.0.0-rc.2.22476.2 | 6 | 07/10/2025 |
| 7.0.0-rc.1.22427.2 | 5 | 07/10/2025 |
| 7.0.0-preview.7.22376.6 | 5 | 07/11/2025 |
| 7.0.0-preview.4.22251.1 | 5 | 07/10/2025 |
| 7.0.0-preview.2.22153.2 | 5 | 07/13/2025 |
| 6.0.30 | 5 | 07/12/2025 |
| 6.0.3 | 4 | 07/10/2025 |
| 6.0.0-rc.1.21452.15 | 5 | 07/11/2025 |
| 5.0.11 | 5 | 07/11/2025 |
| 5.0.10 | 5 | 07/12/2025 |
| 5.0.5 | 4 | 07/11/2025 |
| 5.0.0-preview.6.20312.15 | 6 | 07/11/2025 |
| 5.0.0-preview.3.20215.14 | 5 | 07/12/2025 |
| 3.1.26 | 5 | 07/12/2025 |
| 3.1.12 | 5 | 07/09/2025 |