Azure / Azure/azure-functions-host

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

Open
#5,469 21 comments 12 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
2k
Forks
482
Avg merge
2d 12h
Merged PRs (30d)
38

Description

#### 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

Contributor guide

Open the contributing guide

Research direction

Start with src/WebJobs.Script.WebHost/WebHostServiceCollectionExtensions.cs around line 75 in the v3.x branch, then trace how input and output serializers are registered. Done means applications can configure the output serializer to System.Text.Json while preserving the existing input behavior and avoiding compatibility issues with shared ASP.NET Core domain models.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp
Domain
backend, cloud
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.