我有一个API,可以在其中使用属性路由为资源定义路由。
[Route("api/document/v3/[controller]")]
public class DocumentController : ControllerBase
这导致在资源路径
生成的Swagger Resource Path
我希望 api/document/v3/code>成为基本URL的一部分,并且控制器仅具有/document
因此,生成的Swagger将具有/Document
作为资源或集合的路径。
这是我想要的
I have an api where I defined routes for a resource using attribute routing.
[Route("api/document/v3/[controller]")]
public class DocumentController : ControllerBase
This results in the generated swagger having api/document/v3/
as a prefix before the resource path
Generated swagger resource path
I would like the api/document/v3/
to be part of the base url and the controller to only have /document
so the generated swagger will have /document
as the path for the resource or collection.
Here is an example image of what I want
Path as I want it
发布评论