.net : Failed to load API definition.

228 阅读1分钟

问题背景

在controller中定义了一个hi方法,并且没有标注请求方式 image.png

image.png

解决策略

一、方法修改为private

image.png

二、方法上添加 [ApiExplorerSettings(IgnoreApi =true)]

image.png