JamesNK / Newtonsoft.Json

Json.NET is a popular high-performance JSON framework for .NET
https://www.newtonsoft.com/json
MIT License
10.73k stars 3.25k forks source link

Consider splitting out an Annotations Package #2862

Open QuintinWillison opened 1 year ago

QuintinWillison commented 1 year ago

I'm migrating a codebase from Newtonsoft.Json to Microsoft-'native' System.Text.Json. We can't be the only team doing this.

Newtonsoft JSON annotations are everywhere, often decorating the public interfaces for an assembly where the code within that assembly doesn't actually use Newtonsoft within its implementation. I need to leave those annotations in place, as downstream users who depend on that assembly need those annotations on those entities (this is an iterative migration, not an atomic refactor of all the codebases).

Could you please consider splitting out a new package, presumably relied upon by your primordial Newtonsoft.Json package, which contains only your annotation attributes. I guess it could be named something like Newtonsoft.Json.Attributes. I think this can be done in a non-breaking way, even if the package name doesn't end up matching the root namespace for those attributes (not .NET/NuGet idiomatic, perhaps).

In my opinion this would serve as a friendly gesture to the wider .NET community and in particular those who are transitioning some or all of their codebases to System.Text.Json.

Thanks for your consideration. ❤️