swagger .net core API ambiguous HTTP Action debugging

后端 未结 7 2021
[愿得一人]
[愿得一人] 2021-02-12 10:49

Implementing Swashbuckle/Swagger with .net Core 2 API I am now receiving the 500 error when accessing swagger.json:

NotSupportedException: Ambiguous HTTP

7条回答
  •  半阙折子戏
    2021-02-12 11:37

    This can occur when a method is declared public in a controller, but without REST attributes. Changing the method to protected may address the issue.

    I have seen this error before and usually the errormessage points to the culprit: EBisAPI.Controllers._class.HandleError

    I guess HandleError is a public method in your base class, right? Change it to protected and try again.

提交回复
热议问题