VOOZH about

URL: https://www.nuget.org/packages/Microsoft.AspNetCore.JsonPatch/

⇱ NuGet Gallery | Microsoft.AspNetCore.JsonPatch 10.0.9




👁 Image
Microsoft.AspNetCore.JsonPatch 10.0.9

Prefix Reserved
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Microsoft.AspNetCore.JsonPatch --version 10.0.9
 
 
NuGet\Install-Package Microsoft.AspNetCore.JsonPatch -Version 10.0.9
 
 
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Microsoft.AspNetCore.JsonPatch" Version="10.0.9" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Microsoft.AspNetCore.JsonPatch" Version="10.0.9" />
 
Directory.Packages.props
<PackageReference Include="Microsoft.AspNetCore.JsonPatch" />
 
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Microsoft.AspNetCore.JsonPatch --version 10.0.9
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Microsoft.AspNetCore.JsonPatch, 10.0.9"
 
 
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Microsoft.AspNetCore.JsonPatch@10.0.9
 
 
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Microsoft.AspNetCore.JsonPatch&version=10.0.9
 
Install as a Cake Addin
#tool nuget:?package=Microsoft.AspNetCore.JsonPatch&version=10.0.9
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

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.

Product Versions Compatible and additional computed target framework versions.
.NET net5.0 net5.0 was computed.  net5.0-windows net5.0-windows was computed.  net6.0 net6.0 was computed.  net6.0-android net6.0-android was computed.  net6.0-ios net6.0-ios was computed.  net6.0-maccatalyst net6.0-maccatalyst was computed.  net6.0-macos net6.0-macos was computed.  net6.0-tvos net6.0-tvos was computed.  net6.0-windows net6.0-windows was computed.  net7.0 net7.0 was computed.  net7.0-android net7.0-android was computed.  net7.0-ios net7.0-ios was computed.  net7.0-maccatalyst net7.0-maccatalyst was computed.  net7.0-macos net7.0-macos was computed.  net7.0-tvos net7.0-tvos was computed.  net7.0-windows net7.0-windows was computed.  net8.0 net8.0 was computed.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 was computed.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 is compatible.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows net10.0-windows was computed. 
.NET Core netcoreapp2.0 netcoreapp2.0 was computed.  netcoreapp2.1 netcoreapp2.1 was computed.  netcoreapp2.2 netcoreapp2.2 was computed.  netcoreapp3.0 netcoreapp3.0 was computed.  netcoreapp3.1 netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 netstandard2.0 is compatible.  netstandard2.1 netstandard2.1 was computed. 
.NET Framework net461 net461 was computed.  net462 net462 is compatible.  net463 net463 was computed.  net47 net47 was computed.  net471 net471 was computed.  net472 net472 was computed.  net48 net48 was computed.  net481 net481 was computed. 
MonoAndroid monoandroid monoandroid was computed. 
MonoMac monomac monomac was computed. 
MonoTouch monotouch monotouch was computed. 
Tizen tizen40 tizen40 was computed.  tizen60 tizen60 was computed. 
Xamarin.iOS xamarinios xamarinios was computed. 
Xamarin.Mac xamarinmac xamarinmac was computed. 
Xamarin.TVOS xamarintvos xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (198)

Showing the top 5 NuGet packages that depend on Microsoft.AspNetCore.JsonPatch:

Package 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/f7b4c5716faaee8fb8a289aed29118cad955c45f

Microsoft.AspNetCore.Mvc.Formatters.Json

ASP.NET Core MVC formatters for JSON input and output and for JSON PATCH input using Json.NET.

Microsoft.AspNetCore.App

Provides a default set of APIs for building an ASP.NET Core application. This package requires the ASP.NET Core runtime. This runtime is installed by the .NET Core SDK, or can be acquired separately using installers available at https://aka.ms/dotnet-download.

Microsoft.AspNetCore.All

Provides a default set of APIs for building an ASP.NET Core application, and also includes API for third-party integrations with ASP.NET Core. This package requires the ASP.NET Core runtime. This runtime is installed by the .NET Core SDK, or can be acquired separately using installers available at https://aka.ms/dotnet-download.

RavenDB.Client

RavenDB Client is the client library for accessing RavenDB

GitHub repositories (53)

Showing the top 20 popular GitHub repositories that depend on Microsoft.AspNetCore.JsonPatch:

Repository Stars
aspnet/Mvc
[Archived] ASP.NET Core MVC is a model view controller framework for building dynamic web sites with clean separation of concerns, including the merged MVC, Web API, and Web Pages w/ Razor. Project moved to https://github.com/aspnet/AspNetCore
ravendb/ravendb
ACID Document Database
thepirat000/Audit.NET
An extensible framework to audit executing operations in .NET
asynkron/protoactor-dotnet
Proto Actor - Ultra fast distributed actors for Go, C# and Java/Kotlin
emberstack/kubernetes-reflector
Custom Kubernetes controller that can be used to replicate secrets, configmaps and certificates.
CodeMazeBlog/CodeMazeGuides
The main repository for all the Code Maze guides
security-code-scan/security-code-scan
Vulnerability Patterns Detector for C# and VB.NET
OData/WebApi
OData Web API: A server library built upon ODataLib and WebApi
laochiangx/ABP-ASP.NET-Boilerplate-Project-CMS
ABP module-zero +AdminLTE+Bootstrap Table+jQuery+Redis + sql server+quartz+hangfire权限管理系统
Dotnet-Boxed/Framework
.NET Core Extensions and Helper NuGet packages.
cmu-sei/GHOSTS
GHOSTS (General Human-Oriented Synthetic Teammates and Systems) is a realistic user simulation framework for cyber experimentation, simulation, training, and exercise
JonPSmith/EfCore.GenericServices
A library to help you quickly code CRUD accesses for a web/mobile/desktop application using EF Core.
TeslaFly01/SmartSqlT
🔥🔥🔥 SmartSQL 是一款方便、快捷的数据库文档查询、导出工具!该工具从最初支持CHM文档格式开始,通过不断地探索开发、集思广益和不断改进,又陆续支持Word、Excel、PDF、Html、Xml、Json、MarkDown等文档格式的导出。同时支持SqlServer、MySql、PostgreSQL、SQLite等多种数据库的文档查询和导出功能。
VeritasSoftware/AspNetCore.ApiGateway
Framework for an API Gateway endorsed by the .NET Foundation as revolutionary!
mattfrear/Swashbuckle.AspNetCore.Filters
A bunch of useful filters for Swashbuckle.AspNetCore
mKenfenheuer/steam-deck-windows-usermode-driver
A windows usermode controller driver for the steam deck internal controller.
itlibrium/DDD-starter-dotnet
Sample implementation and comparison of various approaches to building DDD applications. Useful as a baseline to quickly start a DDD dot net project.
Librum-Reader/Librum-Server
The Librum server
josephnhtam/live-streaming-server-net
A .NET implementation of RTMP live streaming server, supporting HTTP-FLV, WebSocket-FLV, HLS, Kubernetes, cloud storage services integration and more.
solenovex/ASP.NET-Core-3.x-REST-API-Tutorial-Code
Version Downloads Last Updated
11.0.0-preview.5.26302.115 751 6/9/2026
11.0.0-preview.4.26230.115 1,316 5/12/2026
11.0.0-preview.3.26207.106 2,459 4/14/2026
11.0.0-preview.2.26159.112 2,631 3/10/2026
10.0.9 229,840 6/9/2026
10.0.8 1,476,020 5/12/2026
10.0.7 2,626,363 4/21/2026
10.0.6 637,865 4/14/2026
10.0.5 2,817,003 3/12/2026
10.0.4 261,537 3/10/2026
9.0.17 8,863 6/9/2026
9.0.16 72,833 5/12/2026
9.0.15 191,155 4/14/2026
9.0.14 223,337 3/10/2026
8.0.28 42,610 6/9/2026
8.0.27 251,876 5/12/2026
8.0.26 392,769 4/14/2026
8.0.25 578,580 3/10/2026
2.3.11 232 6/9/2026
2.3.10 4,510 5/12/2026
Loading failed