I'm trying to control all json output settings across the board, like for normal HTTP 200 OK results to things like when model validation fails (HTTP 400 BAD Request) etc.
I ran across these two methods in startup.cs :-
AddJsonOptions(options => ...)AddJsonFormatters(options => ...)
Can someone please explain the difference between these two? Why I would use one over the other etc?
FWIW, I'm also trying to use Newtonsoft JSON as my json provider under the hood, with settings like this:
var settings = new JsonSerializerSettings
{
ContractResolver = new CamelCasePropertyNamesContractResolver(),
Formatting = Formatting.None,
NullValueHandling = NullValueHandling.Ignore,
DateFormatHandling = DateFormatHandling.IsoDateFormat
};