Use custom response negotiators in Carter
mainCarter uses System.Text.Json by default for content negotiation. You can implement the IResponseNegotiator interface to define how responses should look based on the Accept header.
To use a custom negotiator, register it during the Carter configuration phase:
builder.Services.AddCarter(configurator: c =>
{
c.WithResponseNegotiator<CustomResponseNegotiator>();
});If you prefer Newtonsoft.Json, install the Carter.ResponseNegotiators.Newtonsoft package; Carter will automatically detect and use it without manual registration.