如何防止ServiceStackVS在生成的DTO上添加ApiResponse属性?

时间:2014-09-04 13:47:25

标签: servicestack

如何阻止 ServiceStackVS 在生成的DTO上添加 ApiResponse 属性?

1 个答案:

答案 0 :(得分:1)

您可以通过在NativeTypesFeature插件中添加或删除属性来选择导出的属性,例如,可以在AppHost.Configure()中删除Swagger API属性:

var feature = this.GetPlugin<NativeTypesFeature>();

feature.MetadataTypesConfig.ExportAttributes.RemoveWhere(
    x => x is ApiAttribute || 
         x is ApiMemberAttribute ||
         x is ApiResponseAttribute);