I have a BaseController
with a route defined as follows:
[ApiController]
[Route("trac/[controller]")]
public abstract class BaseController<T> : ControllerBase
And I have another controller inheriting from it:
public class HeadingsController: BaseController<IServices>
{
[HttpGet("{controller}")]
public async Task<ActionResult> ByController(int controller)
=> Ok(await this.Service.ByController(controller));
...
}
which matches perfectly in swagger
But when testing, the route is not matched:
I tried to put [FromRoute]
in front - no change.
All other routes work as expected - including body and query params.
Any suggestions on that?
managed it
param named controller
causes issues
interferes with api naming convention, no issues for swagger though
changed to controllerId
and all works