在NSwag中是否可以仅生成C#客户端接口并用一些自定义属性注释其方法?

问题描述

我正在使用NSwag为我的asp.net核心Web api生成C#rest客户端。目前,我只需要生成客户端接口,而不是类本身。我尝试了以下设置来仅生成C#客户端接口,但它既不生成也不对这两个接口进行分类

    GenerateClientClasses = false 
    GenerateClientInterfaces = true

我的设置有问题吗?

此外,是否有任何方法可以扩展或更改客户端接口的生成代码。例如,如何用一些自定义属性注释客户端接口方法?例如:

public partial interface IGetEmployeeByIdClient
{
    // How to add the following custom attributes to the generated client interface method
    [MyCustomerAttribute("/api/v1/GetEmployeeById/{id}"] )
    System.Threading.Tasks.Task<GetEmployeeByIdQueryResult> GetEmployeeByIdAsync(string id);  
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)