I'm getting the following runtime error when trying to hit any of my API endpoints that are built like the code seen below:
ArgumentException: Invalid type parameter
'Microsoft.AspNetCore.Mvc.JsonResult' specified for 'ActionResult<T>'.

This code functioned as expected in my app in .NET Core 2.1. After upgrading to .NET Core 2.2, this broke.
Here's the code for one of me endpoints in a controller.
[HttpGet]
public async Task<ActionResult<JsonResult>> Get()
{
try
{
MongoConnector mongo = new
MongoConnector(_configService.GetMongoConnectionString());
List<BsonDocument> queues = await mongo.AggregateQueues(
(aggregator) => aggregator
.Match(CommonAggregation.SinceYesterday)
.Sort(CommonAggregation.SortByDate)
.Group(QueueAggregators.GroupQueuesByMessagingName)
);
List<QueueHealth> queueHealth = await MongoConnector.DeserializeList<QueueHealth>(queues);
JsonResult result = new JsonResult(queueHealth);
result.Value = queueHealth;
result.ContentType = "application/json";
result.StatusCode = 200;
return result;
}
catch (Exception ex)
{
logger.Error(ex, "An exception was thrown within /api/MessageQueue");
return new StatusCodeResult(InternalServerError);
}
}
Anyone have any insight on what changed between 2.1 and 2.2 that would cause this? I can't even find anyone else mentioning a similar issue or documentation on the change online.