異常內容
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)
{
}
異常解決。