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后面的符号写错了,也会报这个错误。

 

posted @   0Behavior  阅读(907)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· PowerShell开发游戏 · 打蜜蜂
· 在鹅厂做java开发是什么体验
· 百万级群聊的设计实践
· WPF到Web的无缝过渡:英雄联盟客户端的OpenSilver迁移实战
· 永远不要相信用户的输入:从 SQL 注入攻防看输入验证的重要性
点击右上角即可分享
微信分享提示