Ambiguous HTTP method Actions require an explicit HttpMethod binding for Swagger 2.0

异常内容

NotSupportedException: Ambiguous HTTP method for action . 
Actions require an explicit HttpMethod binding for Swagger 2.0

解决方案

思考:疯狂Google,找到 https://stackoverflow.com/questions/47822177/swagger-net-core-api-ambiguous-http-action-debugging, 但是底下没有有价值的回答。自己琢磨一下,比起一个标准的接口,少了Http请求定义和参数定义。
猜测是因为定义不标准,对Swagger来说,不标准就报错,这没问题。
验证:写一个标准的method。

[HttpPost,Route(test)]
pulic void Test([FromBody] InputDto dto)
{
}

异常解决。

原文地址:https://www.cnblogs.com/AlienXu/p/10770086.html