I am using a singleton with dependency injection to get the default settings I want everywhere:
services.AddSingleton(new JsonSerializerOptions()
{
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
PropertyNameCaseInsensitive = true,
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
});
And then it is available anywhere like so:
public class MyClass(JsonSerializerOptions jsonOpts)
Not sure if this is the best solution - hopefully I never have to change this, as that would warrant a potentially massive regression test.