Microsoft.AspNetCore.JsonPatch 11.0.0-rc.2.26504.105

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:

  1. Update your Program.cs with logic to construct a NewtonsoftJsonPatchInputFormatter:
    static NewtonsoftJsonPatchInputFormatter GetJsonPatchInputFormatter()
    {
        var builder = new ServiceCollection()
            .AddLogging()
            .AddMvc()
            .AddNewtonsoftJson()
            .Services.BuildServiceProvider();
    
        return builder
            .GetRequiredService<IOptions<MvcOptions>>()
            .Value
            .InputFormatters
            .OfType<NewtonsoftJsonPatchInputFormatter>()
            .First();
    }
    
  2. 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:

  1. Annotate it with the HttpPatch attribute
  2. Accept a JsonPatchDocument<TModel>
  3. Call ApplyTo on 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/dotnet/tree/e2f47b0110ed922f21a1522da67279133ce28f32
107
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
59
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/3b519aa7d1a1b66e1d329d694f814e1d8228dc8c
55
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/abc2c7226ff616316cd1e05d76e6c36b49ce06a1
54
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/509f6badec2f3162f0e50330cd9107e5624b379b
53
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/68bb6fb08f8f85bb3cf08953a0d2f4a254eaccff
53
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/36be7ed6d6d56b7da0a2891e3de7ecc2aa48eecd
53
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/50b7e9c661453874aa7a54a3985d5120564bb2e5
53
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/fad253f51b461736dfd3cd9c15977bb7493becef
52
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/be51b1aa73343e45a1d00afd436abad794f471fb
52
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/67acc3d331454956fc06d6de2218a625e3e596f8
52
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/d47e49e9c1e173ac90821f7e89cc38e710274241
52
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/4a42afc5aea63750638e118560d43db04bd9ccc2
52
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/f5084525411d53b81d9950b68616117750b674d4
52
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/d634f2bd1ad6e319f26ff0f1d7ada5539158a19f
52
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/ada5ad97d2114250a05550cb28cc18b9cf9f8993
52
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/417d650029c720dbd2138bcafbb78e2e4ff31bff
52
KubernetesClient
Client library for the Kubernetes open source container orchestrator.
51
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
51
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/39e0501ee91dcf2b9b885d647795184815fb0408
51

.NET 11.0

.NET Framework 4.6.2

.NET Standard 2.0

Version Downloads Last updated
11.0.0-rc.2.26504.105 4 10/13/2026
11.0.0-rc.1.26425.128 24 09/09/2026
11.0.0-preview.7.26381.103 28 08/12/2026
11.0.0-preview.6.26359.118 31 07/18/2026
11.0.0-preview.5.26302.115 32 06/11/2026
11.0.0-preview.4.26230.115 44 05/13/2026
11.0.0-preview.3.26207.106 50 04/15/2026
11.0.0-preview.2.26159.112 41 03/10/2026
11.0.0-preview.1.26104.118 38 02/12/2026
10.0.13 6 10/13/2026
10.0.12 18 09/09/2026
10.0.11 110 08/12/2026
10.0.10 40 07/19/2026
10.0.9 28 06/11/2026
10.0.8 26 05/13/2026
10.0.7 26 04/23/2026
10.0.6 29 04/15/2026
10.0.5 35 03/14/2026
10.0.4 37 03/14/2026
10.0.3 36 02/12/2026
10.0.2 42 01/14/2026
10.0.1 2 10/03/2026
10.0.0 40 12/23/2025
10.0.0-rc.2.25502.107 29 12/20/2025
10.0.0-rc.1.25451.107 36 12/14/2025
10.0.0-preview.7.25380.108 39 12/21/2025
10.0.0-preview.6.25358.103 36 12/19/2025
10.0.0-preview.5.25277.114 28 12/21/2025
10.0.0-preview.4.25258.110 3 10/14/2026
10.0.0-preview.3.25172.1 35 12/21/2025
10.0.0-preview.2.25164.1 25 12/14/2025
10.0.0-preview.1.25120.3 36 12/15/2025
9.0.21 4 10/13/2026
9.0.20 20 09/09/2026
9.0.19 25 08/12/2026
9.0.18 25 07/19/2026
9.0.17 26 06/11/2026
9.0.16 37 05/13/2026
9.0.15 38 04/15/2026
9.0.14 36 03/14/2026
9.0.13 37 02/12/2026
9.0.12 49 01/14/2026
9.0.11 37 12/21/2025
9.0.10 32 12/21/2025
9.0.9 1 10/03/2026
9.0.8 36 12/22/2025
9.0.7 37 12/12/2025
9.0.6 32 12/23/2025
9.0.5 32 12/15/2025
9.0.4 29 12/24/2025
9.0.3 28 12/19/2025
9.0.2 35 12/17/2025
9.0.1 32 12/14/2025
9.0.0 30 12/16/2025
9.0.0-rc.2.24474.3 33 12/14/2025
9.0.0-rc.1.24452.1 33 12/15/2025
9.0.0-preview.7.24406.2 5 09/30/2026
9.0.0-preview.6.24328.4 30 12/15/2025
9.0.0-preview.5.24306.11 34 12/19/2025
9.0.0-preview.4.24267.6 29 12/21/2025
9.0.0-preview.3.24172.13 39 12/14/2025
9.0.0-preview.2.24128.4 35 12/14/2025
9.0.0-preview.1.24081.5 0 02/13/2024
8.0.32 3 10/14/2026
8.0.31 22 09/09/2026
8.0.30 26 08/12/2026
8.0.29 25 07/20/2026
8.0.28 32 06/11/2026
8.0.27 30 05/13/2026
8.0.26 31 04/15/2026
8.0.25 35 03/14/2026
8.0.24 34 02/12/2026
8.0.23 39 01/14/2026
8.0.22 46 12/23/2025
8.0.21 32 12/23/2025
8.0.20 39 12/13/2025
8.0.19 36 12/21/2025
8.0.18 47 12/21/2025
8.0.17 34 12/21/2025
8.0.16 2 09/28/2026
8.0.15 26 12/21/2025
8.0.14 38 12/15/2025
8.0.13 40 12/14/2025
8.0.12 42 12/14/2025
8.0.11 31 12/15/2025
8.0.10 45 12/19/2025
8.0.8 46 12/15/2025
8.0.7 33 12/24/2025
8.0.6 36 12/14/2025
8.0.5 36 12/11/2025
8.0.4 31 12/16/2025
8.0.3 38 12/17/2025
8.0.2 30 12/20/2025
8.0.1 31 12/15/2025
8.0.0 27 12/24/2025
8.0.0-rc.2.23480.2 33 12/21/2025
8.0.0-rc.1.23421.29 32 12/12/2025
8.0.0-preview.7.23375.9 29 12/21/2025
8.0.0-preview.6.23329.11 31 12/14/2025
8.0.0-preview.5.23302.2 39 12/21/2025
8.0.0-preview.4.23260.4 23 12/15/2025
8.0.0-preview.3.23177.8 40 12/15/2025
8.0.0-preview.2.23153.2 40 12/21/2025
8.0.0-preview.1.23112.2 37 12/14/2025
7.0.20 35 12/14/2025
7.0.19 31 12/15/2025
7.0.18 31 12/21/2025
7.0.17 32 12/21/2025
7.0.16 36 12/17/2025
7.0.15 38 12/14/2025
7.0.14 36 12/11/2025
7.0.13 40 12/14/2025
7.0.12 35 12/15/2025
7.0.11 36 12/11/2025
7.0.10 46 12/18/2025
7.0.9 27 12/24/2025
7.0.8 34 12/13/2025
7.0.7 35 12/15/2025
7.0.5 35 12/16/2025
7.0.4 30 12/14/2025
7.0.3 28 12/15/2025
7.0.2 36 12/14/2025
7.0.1 36 12/15/2025
7.0.0 37 12/11/2025
7.0.0-rc.2.22476.2 38 12/21/2025
7.0.0-rc.1.22427.2 34 12/14/2025
7.0.0-preview.7.22376.6 28 12/20/2025
7.0.0-preview.6.22330.3 26 12/21/2025
7.0.0-preview.5.22303.8 33 12/16/2025
7.0.0-preview.4.22251.1 26 12/15/2025
7.0.0-preview.3.22178.4 38 12/14/2025
7.0.0-preview.2.22153.2 32 12/15/2025
7.0.0-preview.1.22109.13 32 12/21/2025
6.0.36 60 12/14/2025
6.0.35 39 12/14/2025
6.0.33 31 12/20/2025
6.0.32 37 12/12/2025
6.0.31 30 12/16/2025
6.0.30 29 12/21/2025
6.0.29 44 12/12/2025
6.0.28 34 12/11/2025
6.0.27 36 12/16/2025
6.0.26 31 12/13/2025
6.0.25 30 12/15/2025
6.0.24 30 12/19/2025
6.0.23 39 12/15/2025
6.0.22 39 12/18/2025
6.0.21 33 12/17/2025
6.0.20 41 12/14/2025
6.0.19 38 12/17/2025
6.0.18 43 12/14/2025
6.0.16 32 12/12/2025
6.0.15 46 12/18/2025
6.0.14 47 12/17/2025
6.0.13 36 12/15/2025
6.0.12 41 12/18/2025
6.0.11 37 12/21/2025
6.0.10 39 12/11/2025
6.0.9 33 12/15/2025
6.0.8 40 12/20/2025
6.0.7 34 12/24/2025
6.0.6 37 12/15/2025
6.0.5 37 12/15/2025
6.0.4 38 12/11/2025
6.0.3 26 12/14/2025
6.0.2 35 12/14/2025
6.0.1 36 12/16/2025
6.0.0 31 12/23/2025
6.0.0-rc.2.21480.10 38 12/21/2025
6.0.0-rc.1.21452.15 39 12/21/2025
6.0.0-preview.7.21378.6 29 12/15/2025
6.0.0-preview.6.21355.2 33 12/21/2025
6.0.0-preview.5.21301.17 27 12/21/2025
6.0.0-preview.4.21253.5 31 12/14/2025
6.0.0-preview.3.21201.13 32 12/14/2025
6.0.0-preview.2.21154.6 40 12/14/2025
6.0.0-preview.1.21103.6 41 12/14/2025
5.0.17 32 12/15/2025
5.0.16 33 12/14/2025
5.0.15 36 12/16/2025
5.0.14 37 12/14/2025
5.0.13 26 12/14/2025
5.0.12 29 12/21/2025
5.0.11 45 12/15/2025
5.0.10 31 12/21/2025
5.0.9 39 12/14/2025
5.0.8 41 12/14/2025
5.0.7 33 12/15/2025
5.0.6 35 12/15/2025
5.0.5 36 12/14/2025
5.0.4 32 12/15/2025
5.0.3 36 12/14/2025
5.0.2 37 12/14/2025
5.0.1 33 12/15/2025
5.0.0 42 12/24/2025
5.0.0-rc.2.20475.17 24 12/21/2025
5.0.0-rc.1.20451.17 2 10/05/2026
5.0.0-preview.8.20414.8 32 12/15/2025
5.0.0-preview.7.20365.19 36 12/14/2025
5.0.0-preview.6.20312.15 35 12/15/2025
5.0.0-preview.5.20279.2 27 12/14/2025
5.0.0-preview.4.20257.10 29 12/14/2025
5.0.0-preview.3.20215.14 33 12/21/2025
5.0.0-preview.2.20167.3 38 12/11/2025
5.0.0-preview.1.20124.5 38 12/15/2025
3.1.32 42 12/21/2025
3.1.31 5 10/03/2026
3.1.30 35 12/21/2025
3.1.29 37 12/14/2025
3.1.28 41 12/14/2025
3.1.27 38 12/11/2025
3.1.26 26 12/21/2025
3.1.25 32 12/21/2025
3.1.24 27 12/14/2025
3.1.23 29 12/21/2025
3.1.22 31 12/21/2025
3.1.21 30 12/21/2025
3.1.20 33 12/13/2025
3.1.19 29 12/13/2025
3.1.18 33 12/21/2025
3.1.17 34 12/15/2025
3.1.16 40 12/11/2025
3.1.15 35 12/14/2025
3.1.14 44 12/15/2025
3.1.13 37 12/14/2025
3.1.12 37 12/21/2025
3.1.11 30 12/21/2025
3.1.10 36 12/13/2025
3.1.9 31 12/18/2025
3.1.8 31 12/12/2025
3.1.7 29 12/18/2025
3.1.6 35 12/24/2025
3.1.5 30 12/24/2025
3.1.4 30 12/15/2025
3.1.3 25 12/14/2025
3.1.2 34 12/11/2025
3.1.1 35 12/14/2025
3.1.0 29 12/15/2025
3.1.0-preview3.19555.2 5 10/05/2026
3.1.0-preview2.19528.8 26 12/17/2025
3.1.0-preview1.19508.20 32 12/21/2025
3.0.3 34 12/24/2025
3.0.2 32 12/14/2025
3.0.0 34 12/14/2025
3.0.0-rc1.19457.4 30 12/21/2025
3.0.0-preview9.19424.4 32 12/14/2025
3.0.0-preview8.19405.7 28 12/17/2025
3.0.0-preview7.19365.7 25 12/21/2025
3.0.0-preview6.19307.2 38 12/15/2025
3.0.0-preview5-19227-01 29 12/21/2025
3.0.0-preview4-19216-03 24 12/21/2025
3.0.0-preview3-19153-02 32 12/14/2025
3.0.0-preview-19075-0444 40 12/14/2025
3.0.0-preview-18579-0056 32 12/15/2025
2.3.13 24 09/09/2026
2.3.12 21 08/12/2026
2.3.11 26 06/11/2026
2.3.10 43 05/14/2026
2.3.9 39 01/12/2026
2.3.8 46 01/12/2026
2.3.0 60 12/11/2025
2.2.0 41 12/23/2025
2.2.0-preview3-35497 27 12/21/2025
2.2.0-preview2-35157 34 12/14/2025
2.2.0-preview1-35029 29 12/13/2025
2.1.1 39 12/15/2025
2.1.0 31 12/15/2025
2.1.0-rc1-final 35 12/20/2025
2.1.0-preview2-final 40 12/21/2025
2.1.0-preview1-final 34 12/21/2025
2.0.0 27 12/24/2025
2.0.0-preview2-final 34 12/15/2025
2.0.0-preview1-final 33 12/21/2025
1.1.2 39 12/23/2025
1.1.1 35 12/14/2025
1.1.0 43 12/16/2025
1.1.0-preview1-final 31 12/14/2025
1.0.0 28 12/24/2025
1.0.0-rc2-final 26 12/20/2025