swagger .net core API ambiguous HTTP Action debugging

后端 未结 7 1900
[愿得一人]
[愿得一人] 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:20

    As i mentioned at "Swashbuckle not creating swagger.json file" :

    1. Decorate all actions with explicit Http Methods like[HttpGet("xxx")],[HttpPost("xxx")] or ... instead of [Route("xxx")].
    2. Decorate public methods in controllers with [NoAction] Attribute.

提交回复
热议问题