Microsoft.AspNetCore.JsonPatch 10.0.0
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/fc93e595ceffbb1e3e85532bf454e92a6a80dd6b
|
85 |
|
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/96103c264e5e8f0485d07018ba27b78cd8227dd2
|
82 |
|
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/55738ff96b832439076e25584cfe0eb3bace9b01
|
80 |
|
KubernetesClient
Client library for the Kubernetes open source container orchestrator.
|
80 |
|
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/e56abc45c4f8adc518abfc11a59849d616431e2c
|
79 |
|
KubernetesClient
Client library for the Kubernetes open source container orchestrator.
|
78 |
|
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/844a82e37cae48af2ab2ee4f39b41283e6bb4f0e
|
77 |
|
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/ae2eabad0e49302d0632a7dde917fdc68d960dc4
|
76 |
|
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/2924ca229b3d6c91b7c9eded119b31dfd7aa1fef
|
76 |
|
KubernetesClient
Client library for the Kubernetes open source container orchestrator.
|
76 |
|
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/0bc3c376f0cd14335e8b3afca69596acabeb1f80
|
75 |
|
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/80fec4e3edea3972e95885f5c0db6ee06072f917
|
74 |
|
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/2b7e994b8a304700a09617ffc5052f0d943bbcba
|
73 |
|
Microsoft.AspNetCore.Mvc.Formatters.Json
ASP.NET Core MVC formatters for JSON input and output and for JSON PATCH input using Json.NET.
|
73 |
|
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/432e6a061f28dda696ba16bc5442328d23b25d93
|
73 |
|
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/25bd01f17d5f01fc78bea5eb5308b2c0d79e2889
|
73 |
|
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/fb4b5a21ebd67b31fff4ddf5c039181da504c932
|
73 |
|
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/b908e913e3befcfe241f3294509e6d9570acc07b
|
72 |
|
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/cdfa43bbe0ecc13757cc6517c9a253de77c3ec56
|
72 |
|
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/e71b34dbb2c0883145c658bed8814ae45f6fe15e
|
71 |
.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 | 8 | 11/14/2025 |
| 10.0.0-rc.2.25502.107 | 11 | 10/16/2025 |
| 10.0.0-rc.1.25451.107 | 9 | 09/12/2025 |
| 10.0.0-preview.7.25380.108 | 12 | 08/14/2025 |
| 10.0.0-preview.6.25358.103 | 15 | 07/16/2025 |
| 10.0.0-preview.5.25277.114 | 16 | 06/11/2025 |
| 10.0.0-preview.4.25258.110 | 25 | 05/15/2025 |
| 10.0.0-preview.3.25172.1 | 25 | 04/12/2025 |
| 10.0.0-preview.2.25164.1 | 23 | 03/22/2025 |
| 10.0.0-preview.1.25120.3 | 27 | 02/27/2025 |
| 9.0.11 | 2 | 11/19/2025 |
| 9.0.10 | 9 | 10/16/2025 |
| 9.0.9 | 14 | 09/11/2025 |
| 9.0.8 | 18 | 08/05/2025 |
| 9.0.7 | 17 | 07/11/2025 |
| 9.0.6 | 19 | 06/12/2025 |
| 9.0.5 | 24 | 05/16/2025 |
| 9.0.4 | 30 | 04/13/2025 |
| 9.0.3 | 26 | 03/12/2025 |
| 9.0.2 | 34 | 02/14/2025 |
| 9.0.1 | 31 | 01/17/2025 |
| 9.0.0 | 37 | 11/13/2024 |
| 9.0.0-rc.2.24474.3 | 42 | 10/11/2024 |
| 9.0.0-rc.1.24452.1 | 42 | 09/19/2024 |
| 9.0.0-preview.7.24406.2 | 42 | 08/14/2024 |
| 9.0.0-preview.6.24328.4 | 46 | 07/10/2024 |
| 9.0.0-preview.5.24306.11 | 46 | 06/11/2024 |
| 9.0.0-preview.4.24267.6 | 42 | 06/08/2024 |
| 9.0.0-preview.3.24172.13 | 54 | 04/13/2024 |
| 9.0.0-preview.2.24128.4 | 45 | 03/19/2024 |
| 9.0.0-preview.1.24081.5 | 53 | 02/17/2024 |
| 8.0.22 | 7 | 11/14/2025 |
| 8.0.21 | 13 | 10/16/2025 |
| 8.0.20 | 5 | 09/12/2025 |
| 8.0.19 | 13 | 08/05/2025 |
| 8.0.18 | 15 | 07/14/2025 |
| 8.0.17 | 21 | 06/12/2025 |
| 8.0.16 | 28 | 05/16/2025 |
| 8.0.15 | 27 | 04/13/2025 |
| 8.0.14 | 25 | 03/11/2025 |
| 8.0.13 | 35 | 02/16/2025 |
| 8.0.12 | 41 | 01/27/2025 |
| 8.0.11 | 37 | 11/13/2024 |
| 8.0.10 | 35 | 10/12/2024 |
| 8.0.8 | 45 | 08/14/2024 |
| 8.0.7 | 42 | 07/11/2024 |
| 8.0.6 | 41 | 06/06/2024 |
| 8.0.5 | 40 | 06/06/2024 |
| 8.0.4 | 45 | 04/14/2024 |
| 8.0.3 | 53 | 03/18/2024 |
| 8.0.2 | 49 | 02/16/2024 |
| 8.0.1 | 60 | 01/10/2024 |
| 8.0.0 | 65 | 11/15/2023 |
| 8.0.0-rc.2.23480.2 | 54 | 10/18/2023 |
| 8.0.0-rc.1.23421.29 | 62 | 09/20/2023 |
| 8.0.0-preview.7.23375.9 | 61 | 08/14/2023 |
| 8.0.0-preview.6.23329.11 | 62 | 07/21/2023 |
| 8.0.0-preview.5.23302.2 | 66 | 07/26/2023 |
| 8.0.0-preview.4.23260.4 | 51 | 05/29/2023 |
| 8.0.0-preview.3.23177.8 | 64 | 05/06/2023 |
| 8.0.0-preview.2.23153.2 | 57 | 06/28/2023 |
| 8.0.0-preview.1.23112.2 | 62 | 06/30/2023 |
| 7.0.20 | 43 | 06/06/2024 |
| 7.0.19 | 43 | 06/06/2024 |
| 7.0.18 | 46 | 04/13/2024 |
| 7.0.17 | 42 | 03/18/2024 |
| 7.0.16 | 53 | 02/16/2024 |
| 7.0.15 | 43 | 01/10/2024 |
| 7.0.14 | 55 | 11/15/2023 |
| 7.0.13 | 57 | 10/24/2023 |
| 7.0.12 | 60 | 10/16/2023 |
| 7.0.11 | 76 | 09/19/2023 |
| 7.0.10 | 53 | 08/28/2023 |
| 7.0.9 | 55 | 07/24/2023 |
| 7.0.8 | 49 | 07/25/2023 |
| 7.0.7 | 76 | 08/16/2023 |
| 7.0.5 | 51 | 07/01/2023 |
| 7.0.4 | 60 | 05/06/2023 |
| 7.0.3 | 49 | 05/27/2023 |
| 7.0.2 | 82 | 01/14/2023 |
| 7.0.1 | 53 | 05/12/2023 |
| 7.0.0 | 59 | 12/01/2022 |
| 7.0.0-rc.2.22476.2 | 58 | 06/30/2023 |
| 7.0.0-rc.1.22427.2 | 68 | 12/26/2022 |
| 7.0.0-preview.7.22376.6 | 62 | 06/20/2023 |
| 7.0.0-preview.6.22330.3 | 70 | 10/18/2022 |
| 7.0.0-preview.5.22303.8 | 59 | 06/28/2023 |
| 7.0.0-preview.4.22251.1 | 70 | 11/23/2022 |
| 7.0.0-preview.3.22178.4 | 66 | 05/27/2022 |
| 7.0.0-preview.2.22153.2 | 66 | 06/20/2023 |
| 7.0.0-preview.1.22109.13 | 61 | 03/10/2022 |
| 6.0.36 | 35 | 11/13/2024 |
| 6.0.35 | 38 | 10/12/2024 |
| 6.0.33 | 43 | 08/14/2024 |
| 6.0.32 | 44 | 07/10/2024 |
| 6.0.31 | 53 | 06/06/2024 |
| 6.0.30 | 40 | 06/06/2024 |
| 6.0.29 | 48 | 04/13/2024 |
| 6.0.28 | 40 | 03/18/2024 |
| 6.0.27 | 42 | 02/16/2024 |
| 6.0.26 | 49 | 01/10/2024 |
| 6.0.25 | 58 | 11/15/2023 |
| 6.0.24 | 46 | 10/24/2023 |
| 6.0.23 | 61 | 10/19/2023 |
| 6.0.22 | 54 | 09/19/2023 |
| 6.0.21 | 57 | 08/17/2023 |
| 6.0.20 | 41 | 07/26/2023 |
| 6.0.19 | 78 | 08/04/2023 |
| 6.0.18 | 49 | 07/23/2023 |
| 6.0.16 | 78 | 05/06/2023 |
| 6.0.15 | 51 | 05/06/2023 |
| 6.0.14 | 56 | 05/06/2023 |
| 6.0.13 | 58 | 03/21/2023 |
| 6.0.12 | 70 | 12/26/2022 |
| 6.0.11 | 72 | 12/02/2022 |
| 6.0.10 | 59 | 06/28/2023 |
| 6.0.9 | 59 | 05/15/2023 |
| 6.0.8 | 71 | 12/04/2022 |
| 6.0.7 | 68 | 04/04/2023 |
| 6.0.6 | 72 | 10/17/2022 |
| 6.0.5 | 62 | 04/16/2023 |
| 6.0.4 | 55 | 12/04/2022 |
| 6.0.3 | 62 | 09/03/2022 |
| 6.0.2 | 63 | 02/23/2022 |
| 6.0.1 | 76 | 12/14/2021 |
| 6.0.0 | 62 | 11/10/2021 |
| 6.0.0-rc.2.21480.10 | 71 | 07/06/2022 |
| 6.0.0-rc.1.21452.15 | 60 | 12/08/2021 |
| 6.0.0-preview.7.21378.6 | 68 | 12/26/2022 |
| 6.0.0-preview.6.21355.2 | 63 | 12/08/2021 |
| 6.0.0-preview.5.21301.17 | 63 | 12/08/2021 |
| 6.0.0-preview.4.21253.5 | 55 | 05/25/2023 |
| 6.0.0-preview.3.21201.13 | 59 | 12/08/2021 |
| 6.0.0-preview.2.21154.6 | 63 | 12/08/2021 |
| 6.0.0-preview.1.21103.6 | 59 | 12/08/2021 |
| 5.0.17 | 54 | 06/26/2023 |
| 5.0.16 | 69 | 12/04/2022 |
| 5.0.15 | 47 | 06/27/2023 |
| 5.0.14 | 53 | 04/01/2023 |
| 5.0.13 | 56 | 12/26/2022 |
| 5.0.12 | 77 | 11/10/2021 |
| 5.0.11 | 48 | 06/24/2023 |
| 5.0.10 | 55 | 12/08/2021 |
| 5.0.9 | 59 | 04/28/2023 |
| 5.0.8 | 58 | 12/26/2022 |
| 5.0.7 | 54 | 06/28/2023 |
| 5.0.6 | 62 | 12/08/2021 |
| 5.0.5 | 73 | 03/22/2023 |
| 5.0.4 | 73 | 09/23/2022 |
| 5.0.3 | 55 | 12/26/2022 |
| 5.0.2 | 67 | 12/08/2021 |
| 5.0.1 | 72 | 03/18/2023 |
| 5.0.0 | 71 | 12/08/2021 |
| 5.0.0-rc.2.20475.17 | 53 | 12/08/2021 |
| 5.0.0-rc.1.20451.17 | 63 | 12/08/2021 |
| 5.0.0-preview.8.20414.8 | 58 | 06/25/2023 |
| 5.0.0-preview.7.20365.19 | 56 | 11/20/2021 |
| 5.0.0-preview.6.20312.15 | 55 | 11/17/2022 |
| 5.0.0-preview.5.20279.2 | 61 | 12/08/2021 |
| 5.0.0-preview.4.20257.10 | 71 | 12/08/2021 |
| 5.0.0-preview.3.20215.14 | 58 | 05/03/2023 |
| 5.0.0-preview.2.20167.3 | 67 | 12/08/2021 |
| 5.0.0-preview.1.20124.5 | 54 | 09/02/2022 |
| 3.1.32 | 47 | 06/27/2023 |
| 3.1.31 | 59 | 05/12/2023 |
| 3.1.30 | 58 | 12/26/2022 |
| 3.1.29 | 57 | 05/17/2023 |
| 3.1.28 | 67 | 05/11/2023 |
| 3.1.27 | 71 | 06/29/2023 |
| 3.1.26 | 55 | 07/02/2023 |
| 3.1.25 | 56 | 06/15/2022 |
| 3.1.24 | 52 | 01/23/2023 |
| 3.1.23 | 63 | 10/12/2022 |
| 3.1.22 | 50 | 06/26/2023 |
| 3.1.21 | 53 | 06/02/2023 |
| 3.1.20 | 58 | 12/08/2021 |
| 3.1.19 | 73 | 05/10/2023 |
| 3.1.18 | 54 | 12/08/2021 |
| 3.1.17 | 55 | 11/10/2021 |
| 3.1.16 | 50 | 07/02/2023 |
| 3.1.15 | 53 | 12/08/2021 |
| 3.1.14 | 53 | 11/17/2021 |
| 3.1.13 | 49 | 12/08/2021 |
| 3.1.12 | 57 | 07/26/2023 |
| 3.1.11 | 48 | 06/27/2023 |
| 3.1.10 | 55 | 11/10/2021 |
| 3.1.9 | 81 | 11/21/2021 |
| 3.1.8 | 63 | 12/08/2021 |
| 3.1.7 | 59 | 12/08/2021 |
| 3.1.6 | 74 | 04/02/2023 |
| 3.1.5 | 68 | 12/08/2021 |
| 3.1.4 | 84 | 12/08/2021 |
| 3.1.3 | 59 | 11/10/2021 |
| 3.1.2 | 72 | 06/29/2023 |
| 3.1.1 | 50 | 11/22/2021 |
| 3.1.0 | 65 | 12/08/2021 |
| 3.1.0-preview3.19555.2 | 65 | 06/28/2023 |
| 3.1.0-preview2.19528.8 | 67 | 06/29/2023 |
| 3.1.0-preview1.19508.20 | 69 | 12/26/2022 |
| 3.0.3 | 86 | 05/12/2023 |
| 3.0.2 | 61 | 12/08/2021 |
| 3.0.0 | 81 | 05/24/2023 |
| 3.0.0-rc1.19457.4 | 60 | 12/08/2021 |
| 3.0.0-preview9.19424.4 | 51 | 12/08/2021 |
| 3.0.0-preview8.19405.7 | 67 | 06/27/2023 |
| 3.0.0-preview7.19365.7 | 68 | 12/08/2021 |
| 3.0.0-preview6.19307.2 | 54 | 12/08/2021 |
| 3.0.0-preview5-19227-01 | 62 | 12/08/2021 |
| 3.0.0-preview4-19216-03 | 61 | 01/02/2023 |
| 3.0.0-preview3-19153-02 | 60 | 12/08/2021 |
| 3.0.0-preview-19075-0444 | 58 | 12/08/2021 |
| 3.0.0-preview-18579-0056 | 67 | 03/06/2023 |
| 2.3.0 | 40 | 01/19/2025 |
| 2.2.0 | 66 | 09/24/2022 |
| 2.2.0-preview3-35497 | 54 | 10/05/2022 |
| 2.2.0-preview2-35157 | 57 | 07/02/2023 |
| 2.2.0-preview1-35029 | 53 | 06/27/2023 |
| 2.1.1 | 62 | 04/26/2023 |
| 2.1.0 | 52 | 11/10/2021 |
| 2.1.0-rc1-final | 65 | 12/08/2021 |
| 2.1.0-preview2-final | 68 | 12/03/2021 |
| 2.1.0-preview1-final | 64 | 12/08/2021 |
| 2.0.0 | 77 | 06/07/2022 |
| 2.0.0-preview2-final | 64 | 12/08/2021 |
| 2.0.0-preview1-final | 55 | 12/15/2021 |
| 1.1.2 | 55 | 12/08/2021 |
| 1.1.1 | 57 | 12/26/2021 |
| 1.1.0 | 60 | 04/27/2023 |
| 1.1.0-preview1-final | 56 | 12/08/2021 |
| 1.0.0 | 59 | 12/08/2021 |
| 1.0.0-rc2-final | 57 | 11/25/2022 |