I need to know if it\'s possible to set up custom operationid, or a naming convention, I mean I know that operation filter can be overwritten the way how operationId is gene
For swashbuckle 5.0, you can use the Name
attribute. You can set it to any string
but I'm a fan of using nameof
like this: nameof(ActualMethodName)
.
[HttpGet("{id:int}", Name = nameof(GetProductById))]
public IActionResult GetProductById(int id) // operationId = "GetProductById"'
or
[HttpGet("{id:int}", Name = "GetProductById")]
public IActionResult GetProductById(int id) // operationId = "GetProductById"'
There are a few other options listed here