azure-functions-extension icon indicating copy to clipboard operation
azure-functions-extension copied to clipboard

Use System.Text.Json instead of Newtonsoft

Open amanbha opened this issue 4 years ago • 2 comments

To avoid external dependencies like Newtonsoft, use System.Text.Json

amanbha avatar Apr 09 '20 21:04 amanbha

I would recommend against this unless you have a really strong reason to remove this dependency. Some things to consider:

  • All Functions SDKs already have this dependency already, whether they want it or not.
  • The Functions runtime has deep integration with Newtonsoft.
  • Adding System.Text.Json means that apps would have dependencies on two JSON SDKs instead of one.

cgillum avatar Apr 10 '20 21:04 cgillum

@cgillum System.Text.Json would be used in this extension and its part of .net, AFAIK it doesn't need an extra nuget ref and apps would still be free to use S.T.J or Newtonsoft.

Would this extension add a transitive dependency on Newtonsoft through Functions nugets? Currently when users want to write a C# Function do they get Newtonsoft as a dependency from Functions? If the answer is yes, to both the above, then its fine to keep using Newtonsoft.

amanbha avatar Apr 10 '20 22:04 amanbha