admin管理员组文章数量:1568345
错误提示如下:
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是存在的,不过并没有任何问题。
版权声明:本文标题:swagger遇到Unable to render this definition,版本不匹配错误 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/dongtai/1727247598a1104822.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论