swagger Unable to render this definition


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、傳入參數模型有問題.

訪問鏈接:http://localhost:<port>/swagger/v1/swagger.json 查看生成的描述終結點的文檔顯示如下json格式,可排查部分錯誤。

 如果你看到這段文字,說明您正使用RSS閱讀或轉自《一棵樹-博客園》,原文地址:https://www.cnblogs.com/atree/p/error-swagger-definition.html 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM