JsonSerializerOptionsFactory Property
Definition
- Namespace
- Codebelt.Extensions.Swashbuckle.AspNetCore
- Assemblies
- Codebelt.Extensions.Swashbuckle.AspNetCore.dll
JsonSerializerOptionsFactory
Gets or sets the function delegate that will resolve a JsonSerializerOptions instance.
public Func<IServiceProvider, JsonSerializerOptions> JsonSerializerOptionsFactory { get; set; }
Property Value
- Func<IServiceProvider, JsonSerializerOptions>
The function delegate that will resolve a JsonSerializerOptions instance.
Remarks
The Swagger team decided to opt-in full hearted to System.Text.Json using the MVC variant of JsonOption to retrieve an instance of JsonSerializerOptions. Weird design choice IMO; leave it to the implementor to decide which configured instance of JsonSerializerOptions to use and avoid redundant configuration that may or may not be a mismatch. More info: https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/1269