admin管理员组

文章数量:1550528

错误提示如下:

Unable to render this definition

The provided definition does not specify a valid version field.

Please indicate a valid Swagger or OpenAPI version field. Supported version fields are swagger: "2.0" and those that match openapi: 3.0.n (for example, openapi: 3.0.0).

网上搜了好多解决方案,大致说的就是这三种:

1、api中的Controller/Action 请加入[HttpPost]或者 [HTTPGet]

2、api中的Controller中有私有方法(全部写道Service)

3、传入参数模型有问题

然鹅,我的问题不在前三种之列😂,而是第4种:

4、api中的Controller/Action中函数名称有重复。

函数名称一样,参数不一样,这样swagger匹配会出错,就报这个错误了。

解决方案:

我的问题符合第4种,名称一样的函数删除或者修改个名字就可以了。

另外,第2种说的私有方法,我的controller是存在的,不过并没有任何问题。

本文标签: 不匹配错误版本unableswagger