简体   繁体   English

使用servicestack从swagger-ui排除完整服务

[英]Exclude complete services from swagger-ui with servicestack

I am trying to figure out a way to hide/remove complete services from the swagger-UI. 我试图找出一种方法来从swagger-UI隐藏/删除完整的服务。 According to the documentation on the servicestack swagger integration there should be a Exclude attribute. 根据servicestack swagger集成的文档 ,应该有一个Exclude属性。 But unfortunately there is not. 但是不幸的是没有。

Is there maybe another way to remove services from the swagger-ui? 是否有另一种方法可以从swagger-ui中删除服务? Removing them from the servicestack metadata would also be nice but is not necessary. 从服务堆栈元数据中删除它们也很不错,但这不是必需的。

From ServiceStack Swagger Docs : ServiceStack Swagger Docs中

Exclude Services from Metadata Pages 从元数据页面排除服务

To exclude entire Services from showing up in Swagger or any other Metadata Services (ie Metadata Pages, Postman, NativeTypes, etc), annotate Request DTO's with: 要排除整个服务不显示在Swagger或任何其他元数据服务(例如,元数据页面,邮递员,NativeType等)中,请使用以下注释注释请求DTO:

[Exclude(Feature.Metadata)]
public class MyRequestDto { ... }

The [Exclude] Attribute exists in ServiceStack.Interfaces project under the ServiceStack.DataAnnotations namespace. [Exclude]属性存在于ServiceStack.Interfaces下项目ServiceStack.DataAnnotations命名空间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM