I'm having two controller controllers: ControllerA and ControllerB. The base class of each controller is ControllerBase.
The ControllerA needs to deserialize JSON in the default option
JsonSerializerOptions.IgnoreNullValues = false;
The ControllerB needs to deserialize JSON with option
JsonSerializerOptions.IgnoreNullValues = true;
I know how to set this option global in Startup.cs
services.AddControllers().AddJsonOptions( options => options.JsonSerializerOptions.IgnoreNullValues = true);
But how to set specific deserialize options to Controller or Action? (ASP.NET Core 3 API)