webapi配置swagger错误记录

 访问:http://localhost:xxxx/swagger/v1/swagger.json

 错误:NotSupportedException: Ambiguous HTTP method for action - Api.Controllers.IdentityController.Get (Api). Actions require an explicit HttpMethod binding for Swagger/OpenAPI 3.0

 

原因:控制器方法定义不标准,加上HttpGet或其他特性即可。

 

posted @ 2020-07-24 16:38  金卧古梁  阅读(509)  评论(0)    收藏  举报