首页 > Web开发 > 详细

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

时间:2019-04-25 18:27:24      阅读:139      评论:0      收藏: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)
{
}

异常解决。

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

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!