Actions require an explicit HttpMethod binding for Swagger/OpenAPI 3.0

Posted 天道酬勤!!!

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Actions require an explicit HttpMethod binding for Swagger/OpenAPI 3.0相关的知识,希望对你有一定的参考价值。

因为定义不标准,对Swagger来说,不标准就报错,这没问题。
验证:写一个标准的method。

  1. [HttpPost,Route("test")] 
  2. pulic void Test([FromBody] InputDto dto)
  3.  { }

异常解决。

以上是关于Actions require an explicit HttpMethod binding for Swagger/OpenAPI 3.0的主要内容,如果未能解决你的问题,请参考以下文章