In my case this method was throwing the error, weirdly enough it was the only action in the controller and there was only one controller in the Api.
[HttpPost(Name = "CreateUser", Order = 0)]
[SwaggerOperation(
Summary = "Endpoint to create a user in the system.",
Description = "",
Tags = new[] { Tag })
]
[Route("User/Create")]
public async Task<ActionResult<UserResponse>> HandleAsync(
[FromBody] CreateUserRequest request,
CancellationToken cancellationToken = default)
{
// Body
}
It turns out if you have these as seperate attributes it confuses Swagger.
[Route("User/Create")]
[HttpPost]
The fix is to combine them into one attribute.
[HttpPost("Membership/Create", Name = "CreatePerson", Order = 0)]
The completed fixed action looks like this.
[HttpPost("Membership/Create", Name = "CreatePerson", Order = 0)]
[SwaggerOperation(
Summary = "Endpoint to create a user in the system.",
Description = "",
Tags = new[] { Tag })
]
[Route("User/Create")]
public