仿制药的宣传命名问题
我希望Swagger为通用子模型生成单独生成模型,如下所示:
public class TheModel<T>
{
public IEnumerable<T> GenericModel { get; set; }
}
public class GenericModel
{
}
public class AnotherGenericModel
{
}
Swagger生成以下模式:
- genericModel
- genericModelThemodelthemodelthemodel
- entergenericModel entergenericModel
- enternGenericModelTheModelThemas shemodecmodel
themas be:
- generiCmodel
- themas the evenericmodel themodel&lt;
- 另一个genericModel
- themodel&lt; enternGenericModel&gt;
我想更改创建的模式更改为预期的模式。
这可以用swashbuckle完成吗?
I want swagger to generate models seperately for generic sub models as shown in the example below:
public class TheModel<T>
{
public IEnumerable<T> GenericModel { get; set; }
}
public class GenericModel
{
}
public class AnotherGenericModel
{
}
Swagger generates the following schemas:
- GenericModel
- GenericModelTheModel
- AnotherGenericModel
- AnotherGenericModelTheModel
What I want the schemas to be:
- GenericModel
- TheModel<GenericModel>
- AnotherGenericModel
- TheModel<AnotherGenericModel>
I want to change the schemas created changed to the expected schemas.
Can this be done with Swashbuckle?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我解决了自己的问题,并提出了以下解决方案:
并将其添加到startup.cs
swaggergenoptions
I have solved my own question and came up with the following solution shown below:
And add this to the Startup.cs
SwaggerGenOptions