![]() |
VOOZH | about |
dotnet add package Microsoft.AspNetCore.JsonPatch --version 10.0.9
NuGet\Install-Package Microsoft.AspNetCore.JsonPatch -Version 10.0.9
<PackageReference Include="Microsoft.AspNetCore.JsonPatch" Version="10.0.9" />
<PackageVersion Include="Microsoft.AspNetCore.JsonPatch" Version="10.0.9" />Directory.Packages.props
<PackageReference Include="Microsoft.AspNetCore.JsonPatch" />Project file
paket add Microsoft.AspNetCore.JsonPatch --version 10.0.9
#r "nuget: Microsoft.AspNetCore.JsonPatch, 10.0.9"
#:package Microsoft.AspNetCore.JsonPatch@10.0.9
#addin nuget:?package=Microsoft.AspNetCore.JsonPatch&version=10.0.9Install as a Cake Addin
#tool nuget:?package=Microsoft.AspNetCore.JsonPatch&version=10.0.9Install as a Cake Tool
Microsoft.AspNetCore.JsonPatch provides ASP.NET Core support for JSON PATCH requests.
To use Microsoft.AspNetCore.JsonPatch, follow these steps:
dotnet add package Microsoft.AspNetCore.JsonPatch
dotnet add package Microsoft.AspNetCore.Mvc.NewtonsoftJson
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();
System.Text.JsonTo add support for JSON Patch using Newtonsoft.Json while continuing to use System.Text.Json for other input and output formatters:
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();
}
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddControllers(options =>
{
options.InputFormatters.Insert(0, GetJsonPatchInputFormatter());
});
To define an action method for a JSON Patch in an API controller:
HttpPatch attributeJsonPatchDocument<TModel>ApplyTo on the patch document to apply changesFor 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.
For additional documentation and examples, refer to the official documentation on JSON Patch in ASP.NET Core.
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. |
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 |
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 |