Swagger UI 报错

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 的 public 方法没有指定 HttpMethodAttribute

解决:设置为 HttpGet 或者 HttpPost 

posted @ 2023-11-06 23:56  深圳大漠  阅读(2670)  评论(0编辑  收藏  举报