【发布时间】:2019-06-12 04:46:52
【问题描述】:
我浏览了很多文档并搜索了互联网,但是我无法找到如何使用 NSwag 执行以下操作:
services.AddSwaggerGen(c =>
{
c.CustomSchemaIds(type => type.FullName);
};
这取自 Swashbuckle,我正在寻找 NSwag 中的等价物。
我想要这个是因为我有嵌套的 DTO 类,它们带有编号后缀,我希望能够通过父类 + 实际 DTO 而不是编号后缀来区分这些 DTO:
using System.Collections.Generic;
namespace Blog.Api.Responses
{
public class IndustriesResponse : List<IndustriesResponse.IndustryDto>
{
public class IndustryDto
{
public string Code { get; set; }
public bool IsEditable { get; set; }
}
}
}
using System.Collections.Generic;
namespace Blog.Api.Requests
{
public class UpdateIndustriesRequest : List<UpdateIndustriesRequest.IndustryDto>
{
public class IndustryDto
{
public string Code { get; set; }
public bool IsEditable { get; set; }
}
}
}
【问题讨论】:
标签: nswag