As stated in this article: adding NewtonsoftJson to the application now enables json patch support. I'm wondering how to add NewthonsoftJson without enabling json patch?
JsonPatch support is handled through the NewtonsoftJsonPatchInputFormatter type. If you don't want this to be enabled, remove it from the InputFormatters collection. Here's an example:
services.AddControllers()
.AddNewtonsoftJson()
.AddMvcOptions(o => o.InputFormatters.RemoveType<NewtonsoftJsonPatchInputFormatter>());
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With