Skip to main content
net11.0

ASP.NET Core support for JSON PATCH, based on System.Text.Json serialization. This package was built from the source code at https://github.com/dotnet/dotnet/tree/3551975be08744f0418857c5bed8ab1545c5dd47

Published
Sep 8, 2026
1mo ago
Total Downloads
968.8K
968,753

Install

dotnet add package Microsoft.AspNetCore.JsonPatch.SystemTextJson --version 11.0.0-rc.1.26425.128
ProductVersions
.NET
net11.0

README

About

Microsoft.AspNetCore.JsonPatch.SystemTextJson provides ASP.NET Core support for JSON PATCH requests.

How to Use

To use Microsoft.AspNetCore.JsonPatch.SystemTextJson, follow these steps:

Installation

dotnet add package Microsoft.AspNetCore.JsonPatch.SystemTextJson

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.SystemTextJson is released as open-source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.

Changes from Previous Version

No structural changes between v11.0.0-preview.7.26381.103 and v11.0.0-rc.1.26425.128.

Adoption Assessment

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

This version is marked prerelease. Validate its API and upgrade path before production use.Compatibility metadata lists 1 target framework; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.