question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add Config to set output serializer to System.Text.Json

See original GitHub issue

What problem would the feature you’re requesting solve? Please describe.

Solves the problem that input serializer and output serializer are different. Function v3 uses System.Text.Json as input serializer and Newtonsoft.Json as output serializer. (#5299)

When sharing a Domain Model with an ASP.NET Core application, different serializers can cause compatibility issues.

Describe the solution you’d like

I need to change the output serializer to System.Text.Json.

Describe alternatives you’ve considered

There is a way to configure all applications to use Newtonsoft.Json. However, it does not match the current trend of .NET Core.

Additional context

https://github.com/Azure/azure-functions-host/blob/v3.x/src/WebJobs.Script.WebHost/WebHostServiceCollectionExtensions.cs#L75

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:8
  • Comments:18 (4 by maintainers)

github_iconTop GitHub Comments

22reactions
snapfishercommented, Aug 29, 2021

So for .Net 6 will this functionality be available for all c# functions or only the isolated process functions?

13reactions
abouroubicommented, Jul 26, 2022

Is there any news on this ? Now that .NET 6 us supported and the v4 is out

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to instantiate JsonSerializerOptions with System.Text. ...
If you use JsonSerializerOptions repeatedly with the same options, don't create a new JsonSerializerOptions instance each time you use it.
Read more >
How to globally set default options for System.Text.Json. ...
DefaultSettings = new JsonSerializerOptions { PropertyNamingPolicy = JsonNamingPolicy.CamelCase // etc. }; // This uses my options var soA = ...
Read more >
Using multiple JSON serialization settings in ASP.NET Core
For JSON, by default, ASP.NET Core uses SystemTextJsonInputFormatter and SystemTextJsonOutputFormatter ; both of these use the JSON ...
Read more >
Introduction to System.Text.Json Through Examples
We create a new method called DeserializeExample() . In the method body, we create a string variable and load it with JSON text....
Read more >
Configuring JSON options in ASP.NET Core
In this post, I describe how to configure JSON serializer options in an ASP.NET Core application (including minimal API).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found