-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JsonPatchDocument should use System.Text.Json #24333
Comments
I propose to:
|
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process. |
Thanks for your willingness to help. |
There have been many issues reported regarding json patch still being tied to Newtonsoft.Json deserialization. The issues are caused by adverse effects of the association, or directly indicating dissatisfaction with it: System.Text.Json has merits over Newtonsoft.Json purported by Microsoft with indication to fully remove the Json.NET dependency from ASP.NET Core.
Configuration of json patch to only use Newtonsoft.Json processing for patch requests is contrived, requiring building an entire separate service collection with complete MVC to pull an input formatter with appropriate DI. To indicate the intent of complete System.Text.Json support in ASP.NET Core, not have the support, and then to consistently delay in the face of consistent issues is extremely discouraging: |
I wonder if the easiest way to have that feature added wouldn't be to fork the feature project https://github.com/dotnet/aspnetcore/commits/master/src/Features/JsonPatch in another repo |
This is bit of an annoying oversight. Any news? |
+1, Everything is moving to System.Text.Json... Swagger, Refit, etc... this needs to be addressed. |
Do you have any plans to use JsonPatchDocument with System.Text.Json in upcoming .NET 6 ? |
Has anybody found good open source json patch library for system text json? |
|
A lot of projects have dropped support for Newtonsoft.Json (especially for annotations) in favor of System.Text.Json |
@pranavkm I think this is worth looking into. It is a bummer that we have to rely on Newtonsoft. The code in the documentation throws |
Still a issue? Keeps us from switching. |
Yes. |
Install this package Microsoft.AspNetCore.Mvc.Formatters.Json for System.Text.Json |
This seems to use newtonsoft from Microsoft.AspNetCore.JsonPatch |
Indirectly your are https://www.nuget.org/packages/Microsoft.AspNetCore.JsonPatch/ |
@Havunen solution works very well. I have just given the GitHub project a star :) Highly recommend we all use this until Microsoft comes up with a solution |
this is something that should be coming with the framework instead of doing a custom model binder to map all parameters. Microsoft should follow the standard: https://datatracker.ietf.org/doc/html/rfc6902 |
mkArtakMSFT you're thinking quite a lot, maybe time to do anything? :) |
Happy 4 year anniversary for a very important issue :( |
I've tried this out and it worked out of the box, brilliant work! |
Its niggling and neglected issues like this that cause many enterprise projects to abandon using the .Net framework entirely and move other API frameworks like Python FastAPI (https://medium.com/@david.danier/how-to-handle-patch-requests-with-fastapi-c9a47ac51f04) or Java SpringBoot 3 (https://www.baeldung.com/spring-rest-json-patch). .Net is regarded as incomplete for enterprise work due to such issues and makes advocating for it's continued use in the enterprise really difficult when competing frameworks offer a friction free developer experience. |
This issue has been open for a long time and has many comments and upvotes, so we're evaluating this as a potential feature for .NET 10. There are a number of third party packages, several mentioned in this issue, that provide support for JSON Patch with System.Text.Json. In light of that, we'd like to hear from users whether it's necessary to add this support into the core framework or if support with a third party package is acceptable. Bear in mind that adding this support to the core framework will require resources that could otherwise be applied to other features. So think of the most important feature you're hoping for in .NET 10, and if built-in JSON Patch support is more important than that, we definitely want to hear that perspective. And we also want to hear the contrary -- that support from a third party package is perfectly fine for you. Please share your views on this question below, and especially the "why" behind your views, so we can apply our resources in the most impactful way for .NET users. Thank you! |
Hi Mike, I strongly believe that the PATCH verb and an Operation object are long overdue to be included in .NET. |
I agree with Carl, since JSON patch is a standard, it should be something that has native support in the framework.
There are some good projects that offer this functionality that can benefit from Microsoft sponsorship (Havunen/SystemTextJsonPatch: SystemTextJsonPatch is a JSON Patch (JsonPatchDocument) RFC 6902 implementation for .NET using System.Text.Json<https://github.com/Havunen/SystemTextJsonPatch>)
Additionally native integration for the below in AspNetCore will be much appreciated and contribute to increased adoption of AspNetCore for microservices in the enterprise.
The below are really required to enable parity with frameworks like Spring Boot, without which .Net will continue to steadily lose ground in the enterprise where these CNCF projects are very popular and in high demand.
Apache Kafka (a good 3rd party project that would benefit from Microsoft sponsorship ch-robinson/dotnet-avro: An Avro implementation for .NET<https://github.com/ch-robinson/dotnet-avro>),
Databricks & Apache Spark (without having to pay for the CData 3rd party driver) (dotnet/spark: .NET for Apache® Spark™ makes Apache Spark™ easily accessible to .NET developers.<https://github.com/dotnet/spark>_ another project that would benefit from Microsoft sponsorship)
Apache Flink
…________________________________
From: Carl Blanchard ***@***.***>
Sent: 06 February 2025 23:14
To: dotnet/aspnetcore ***@***.***>
Cc: lincoln42 ***@***.***>; Comment ***@***.***>
Subject: Re: [dotnet/aspnetcore] JsonPatchDocument should use System.Text.Json in ASP.NET vNext (#24333)
Hi Mike,
I strongly believe that the PATCH verb and an Operation object are long overdue to be included in .NET.
While I understand that PATCH was introduced later than other HTTP verbs, it is still an RFC standard, and its official implementation in .NET is long overdue. Standardising it would greatly improve consistency and best practices across the ecosystem.
https://datatracker.ietf.org/doc/html/rfc6902#section-4.1
—
Reply to this email directly, view it on GitHub<#24333 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AE4KJ3FJ2MKPKBOU2DXXNXL2OPUGJAVCNFSM4PITFYTKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TENRUGEZTEOBWGAYA>.
You are receiving this because you commented.
|
I think the frustration the community has with feature requests like this is that there is seemingly more mental effort spent punting vs. the time it would take to add the missing element in. To be fair though, this is hardly a problem unique to .Net Core. If you've been in software development long enough you'd had at least one "why we shouldn't bother meeting" that runs longer and uses more resources than implementation time to build something. I get the counter argument that if there is no vetting, that leads to system bloat and what I'll call the "rural road problem" where there is more to maintain than resources can afford. TLDR - Low effort, low maintenance, high reward features- there has to be a more efficient path to vet these and get them in. |
This should be natively supported by Microsoft in my opinion, not by a
third party library. Adoption is going to be faster coming from Microsoft
than other libraries.
…On Sun, Feb 9, 2025, 2:15 PM lincoln42 ***@***.***> wrote:
I agree with Carl, since JSON patch is a standard, it should be something
that has native support in the framework.
There are some good projects that offer this functionality that can
benefit from Microsoft sponsorship (Havunen/SystemTextJsonPatch:
SystemTextJsonPatch is a JSON Patch (JsonPatchDocument) RFC 6902
implementation for .NET using System.Text.Json<
https://github.com/Havunen/SystemTextJsonPatch>)
Additionally native integration for the below in AspNetCore will be much
appreciated and contribute to increased adoption of AspNetCore for
microservices in the enterprise.
The below are really required to enable parity with frameworks like Spring
Boot, without which .Net will continue to steadily lose ground in the
enterprise where these CNCF projects are very popular and in high demand.
Apache Kafka (a good 3rd party project that would benefit from Microsoft
sponsorship ch-robinson/dotnet-avro: An Avro implementation for .NET<
https://github.com/ch-robinson/dotnet-avro>),
Databricks & Apache Spark (without having to pay for the CData 3rd party
driver) (dotnet/spark: .NET for Apache® Spark™ makes Apache Spark™ easily
accessible to .NET developers.<https://github.com/dotnet/spark>_ another
project that would benefit from Microsoft sponsorship)
Apache Flink
________________________________
From: Carl Blanchard ***@***.***>
Sent: 06 February 2025 23:14
To: dotnet/aspnetcore ***@***.***>
Cc: lincoln42 ***@***.***>; Comment ***@***.***>
Subject: Re: [dotnet/aspnetcore] JsonPatchDocument should use
System.Text.Json in ASP.NET vNext (#24333)
Hi Mike,
I strongly believe that the PATCH verb and an Operation object are long
overdue to be included in .NET.
While I understand that PATCH was introduced later than other HTTP verbs,
it is still an RFC standard, and its official implementation in .NET is
long overdue. Standardising it would greatly improve consistency and best
practices across the ecosystem.
https://datatracker.ietf.org/doc/html/rfc6902#section-4.1
—
Reply to this email directly, view it on GitHub<
#24333 (comment)>,
or unsubscribe<
https://github.com/notifications/unsubscribe-auth/AE4KJ3FJ2MKPKBOU2DXXNXL2OPUGJAVCNFSM4PITFYTKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TENRUGEZTEOBWGAYA>.
You are receiving this because you commented.
—
Reply to this email directly, view it on GitHub
<#24333 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIMQ5FKK55F7E2FDHY22SD2O6SOVAVCNFSM4PITFYTKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TENRUGY2TINRUGIYQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
In terms of prioritising for .Net 10, native support for CNCF projects with high enterprise adoption rates like Kafka, Spark, Flink & Databricks will go a long way to increasing the adoption of .Net in the enterprise just like the move to being able to run cross platform did for the adoption of .Net Core for microservies on Kubernetes.
________________________________
From: zinov ***@***.***>
Sent: 10 February 2025 17:34
To: dotnet/aspnetcore ***@***.***>
Cc: lincoln42 ***@***.***>; Comment ***@***.***>
Subject: Re: [dotnet/aspnetcore] JsonPatchDocument should use System.Text.Json in ASP.NET vNext (#24333)
This should be natively supported by Microsoft in my opinion, not by a
third party library. Adoption is going to be faster coming from Microsoft
than other libraries.
On Sun, Feb 9, 2025, 2:15 PM lincoln42 ***@***.***> wrote:
I agree with Carl, since JSON patch is a standard, it should be something
that has native support in the framework.
There are some good projects that offer this functionality that can
benefit from Microsoft sponsorship (Havunen/SystemTextJsonPatch:
SystemTextJsonPatch is a JSON Patch (JsonPatchDocument) RFC 6902
implementation for .NET using System.Text.Json<
https://github.com/Havunen/SystemTextJsonPatch>)
Additionally native integration for the below in AspNetCore will be much
appreciated and contribute to increased adoption of AspNetCore for
microservices in the enterprise.
The below are really required to enable parity with frameworks like Spring
Boot, without which .Net will continue to steadily lose ground in the
enterprise where these CNCF projects are very popular and in high demand.
Apache Kafka (a good 3rd party project that would benefit from Microsoft
sponsorship ch-robinson/dotnet-avro: An Avro implementation for .NET<
https://github.com/ch-robinson/dotnet-avro>),
Databricks & Apache Spark (without having to pay for the CData 3rd party
driver) (dotnet/spark: .NET for Apache® Spark™ makes Apache Spark™ easily
accessible to .NET developers.<https://github.com/dotnet/spark>_ another
project that would benefit from Microsoft sponsorship)
Apache Flink
________________________________
From: Carl Blanchard ***@***.***>
Sent: 06 February 2025 23:14
To: dotnet/aspnetcore ***@***.***>
Cc: lincoln42 ***@***.***>; Comment ***@***.***>
Subject: Re: [dotnet/aspnetcore] JsonPatchDocument should use
System.Text.Json in ASP.NET vNext (#24333)
Hi Mike,
I strongly believe that the PATCH verb and an Operation object are long
overdue to be included in .NET.
While I understand that PATCH was introduced later than other HTTP verbs,
it is still an RFC standard, and its official implementation in .NET is
long overdue. Standardising it would greatly improve consistency and best
practices across the ecosystem.
https://datatracker.ietf.org/doc/html/rfc6902#section-4.1
—
Reply to this email directly, view it on GitHub<
#24333 (comment)>,
or unsubscribe<
https://github.com/notifications/unsubscribe-auth/AE4KJ3FJ2MKPKBOU2DXXNXL2OPUGJAVCNFSM4PITFYTKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TENRUGEZTEOBWGAYA>.
You are receiving this because you commented.
—
Reply to this email directly, view it on GitHub
<#24333 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIMQ5FKK55F7E2FDHY22SD2O6SOVAVCNFSM4PITFYTKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TENRUGY2TINRUGIYQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
—
Reply to this email directly, view it on GitHub<#24333 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AE4KJ3FD7MWNVVZRGFBMFW32PDPLHAVCNFSM4PITFYTKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TENRUHA3TMNRZGY2A>.
You are receiving this because you commented.
|
@mikekistler It's great to see that Microsoft is looking at this. I would prefer to see first-class support from Microsoft in the core framework and I'll try to break down my "why" reasoning as simply as possible to meet what you're looking for to justify dedicating resources. JSON Patch support is more important than [insert other possible new .NET features]Why do I think the functionality itself is important? JSON Patch support is highly important to me, and specifically more important than other possible .NET features, because I work in REST web services all-day-every-day. This means an implementation of Stability / Longevity of a solutionWhy do I think Microsoft should provide it in the core framework as opposed to relying on third-party solutions? Simply put here, at least from my point of view, Microsoft has done a fantastic job of keeping stability in their APIs for long periods of time. I'm not saying you guys are perfect but overall you're d*** good. But I'm not saying that to flatter. A lot of my feelings on this point have to do with recent failings in trust for widely-used packages. I'm thinking specifically of Moq and FluentAssertions. My examples there are nice-to-haves ultimately yet still caused great consternation when they changed their license or inserted some sketchy functionality. Something this critical, IMHO, needs to be provided by a funded organization that is highly unlikely to rug-pull like this. Hope that helps your analysis of this issue. |
i think the team need better product manager |
I’d recommend keeping the discussion on topic. Don’t attack the people on the team, and follow the code of conduct. There are lots of ways to share frustration without sinking to ad hominem attacks. Yes we’re looking at the cost of implementing this and yes you’re have to wait for .NET 10. If that’s too long a wait @abratv feel free to use the package referenced several times on this very long thread. https://github.com/Havunen/SystemTextJsonPatch |
Thanks to all who shared your thoughts on this issue. We posted the roadmap for .NET 10 earlier this week and we have included this in the proposed set of features for ASP.NET. As always, the roadmap is "an aspirational list of what we hope to get to", but given the level of frustration with this issue we are very hopeful that we can deliver this feature in .NET 10. |
Thanks much appreciated. Looking forward to .Net 10.
Sent from Outlook for Android<https://aka.ms/AAb9ysg>
…________________________________
From: Mike Kistler ***@***.***>
Sent: Thursday, February 27, 2025 10:38:17 PM
To: dotnet/aspnetcore ***@***.***>
Cc: lincoln42 ***@***.***>; Comment ***@***.***>
Subject: Re: [dotnet/aspnetcore] JsonPatchDocument should use System.Text.Json (#24333)
Thanks to all who shared your thoughts on this issue. We posted the roadmap for .NET 10<http://aka.ms/dotnet/roadmap> earlier this week and we have included this in the proposed set of features for ASP.NET. As always, the roadmap is "an aspirational list of what we hope to get to", but given the level of frustration with this issue we are very hopeful that we can deliver this feature in .NET 10.
—
Reply to this email directly, view it on GitHub<#24333 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AE4KJ3BS3VFPS5O5XE6R5FT2R6HVTAVCNFSM4PITFYTKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TENRYHEZDMMJZHAZQ>.
You are receiving this because you commented.Message ID: ***@***.***>
[mikekistler]mikekistler left a comment (dotnet/aspnetcore#24333)<#24333 (comment)>
Thanks to all who shared your thoughts on this issue. We posted the roadmap for .NET 10<http://aka.ms/dotnet/roadmap> earlier this week and we have included this in the proposed set of features for ASP.NET. As always, the roadmap is "an aspirational list of what we hope to get to", but given the level of frustration with this issue we are very hopeful that we can deliver this feature in .NET 10.
—
Reply to this email directly, view it on GitHub<#24333 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AE4KJ3BS3VFPS5O5XE6R5FT2R6HVTAVCNFSM4PITFYTKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TENRYHEZDMMJZHAZQ>.
You are receiving this because you commented.Message ID: ***@***.***>
|
@mikekistler this is great :) Thank you. |
Finally. This is something that is impacting every integration that is
relying on this method using rest standards. I think the community is going
to be happy with this delivery
…On Fri, Feb 28, 2025, 9:57 AM Carl Blanchard ***@***.***> wrote:
@mikekistler <https://github.com/mikekistler> this is great :) Thank you.
—
Reply to this email directly, view it on GitHub
<#24333 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIMQ5GLK2RI5HQYFIBSYR32SB2MXAVCNFSM4PITFYTKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TENRZGA4DKMRTGI3Q>
.
You are receiving this because you commented.Message ID:
***@***.***>
[image: carlblanchard]*carlblanchard* left a comment
(dotnet/aspnetcore#24333)
<#24333 (comment)>
@mikekistler <https://github.com/mikekistler> this is great :) Thank you.
—
Reply to this email directly, view it on GitHub
<#24333 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIMQ5GLK2RI5HQYFIBSYR32SB2MXAVCNFSM4PITFYTKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TENRZGA4DKMRTGI3Q>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Related to #16968
Will you accept pull-request with this feature?
The text was updated successfully, but these errors were encountered: