Skip to content

Don't forget about JsonSerializerOptions.CreateForWeb() #34626

@jozkee

Description

@jozkee

This is a leftover from #32937, we didn't add the default options that are meant to sync the options between System.Net.Http.Json and ASP.NET.

As per the spec, the next API should be added as well.

namespace System.Text.Json
{
    public partial class JsonSerializerOptions
    {
        public static JsonSerializerOptions CreateForWeb();
    }
}

Above method should return an options instance as the following:

new JsonSerializerOptions 
{ 
    PropertyNameCaseInsensitive = true, 
    PropertyNamingPolicy = JsonNamingPolicy.CamelCase 
}

Metadata

Metadata

Assignees

Labels

api-approvedAPI was approved in API review, it can be implementedarea-System.Text.Jsongood first issueIssue should be easy to implement, good for first-time contributors

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions