For anyone reaching this thread, instead of doing Results.Ok
or simply returning an object from the minimal API endpoint, use Results.Content
// before
return result;
// after
var json = Newtonsoft.Json.JsonConvert.SerializeObject(result);
return Results.Content(json, "application/json");