I am using ErrorOr (https://github.com/amantinband/error-or) library to return responses from my Api. However when I return response from my api, it is giving this error:
Following is the code:
[HttpPost("token", Name = "GenerateToken")]
[ProducesResponseType<GenerateToken.Response>((int)HttpStatusCode.OK)]
public async Task<IActionResult> GenerateToken(GenerateToken.Command command)
{
var response = await mediator.Send(command);
return await response.MatchAsync(
value => Ok(value),
errors => BadRequest(errors));
}
What I am doing wrong here? Any help will be appreciated.