首页 文章

Swagger为自定义Restful API生成定义(C#.NET)

提问于
浏览
1

我正在尝试使用swagger作为我的RESTful api(.net和c#) . 它是一个自定义的restful api(不是ASP.NET Web API,也不是Web应用程序) .

public interface IEmployee
{
    [CustomSecurity(Session.Required)]
    EmployeeResponse GetEmployee(EmployeeRequest request);  
}

我正在使用NSwag(https://github.com/NSwag/NSwag),它有NSwagStudio来生成规范,但没有成功,因为它没有指出方法 . 有没有办法以其他方式做到这一点?如何让swagger理解我对操作的自定义属性?

1 回答

相关问题