79398028

Date: 2025-01-29 19:56:07
Score: 0.5
Natty:
Report link

I was able to get it working by adding an output formatter to my controller middleware that will omit the 204 No Content response code. I'm not sure if this is the best approach, but I'm trying to avoid returning an IActionResult in my controller:

builder.Services.AddControllers(o =>
{
    o.InputFormatters.Insert(0, KoJPIF.GetJsonPatchInputFormatter());
    o.OutputFormatters.RemoveType<HttpNoContentOutputFormatter>();
    
}).AddNewtonsoftJson();

I found this workaround here: RemoveNoContent

Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: GH DevOps