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或其他特性即可。

猜你喜欢

转载自www.cnblogs.com/jinwoguliang/p/13372729.html
今日推荐