swagger报错Unable to render this definition
问题描述:访问swagger时,报错end of the stream or a document separator is expected,
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
).
如下图
解决方法:网络提供的方法,多是排除Controller有重复接口名称,什么json里面有空格啥的,什么版本问题啥的.....
本人情况是网址写错了也会报错,例如正确的是:http://localhost:6103/api-doc/index.html,
我写成了http://localhost:6103/api-doc/index-html或者http://localhost:6103/api-doc/index,html,就是index后面的符号写错了,也会报这个错误。
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· PowerShell开发游戏 · 打蜜蜂
· 在鹅厂做java开发是什么体验
· 百万级群聊的设计实践
· WPF到Web的无缝过渡:英雄联盟客户端的OpenSilver迁移实战
· 永远不要相信用户的输入:从 SQL 注入攻防看输入验证的重要性