设为首页 加入收藏

TOP

Ambiguous HTTP method Actions require an explicit HttpMethod binding for Swagger 2.0
2019-09-17 18:44:59 】 浏览:29
Tags:Ambiguous HTTP method Actions require 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)
{
}

异常解决。

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇分享一个.NET平台开源免费跨平台.. 下一篇关于mvc中传递匿名对象,view中无..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目