Exclude complete services from swagger-ui with servicestack

510 views Asked by At

I am trying to figure out a way to hide/remove complete services from the swagger-UI. According to the documentation on the servicestack swagger integration there should be a Exclude attribute. But unfortunately there is not.

Is there maybe another way to remove services from the swagger-ui? Removing them from the servicestack metadata would also be nice but is not necessary.

1

There are 1 answers

2
mythz On

From ServiceStack Swagger Docs:

Exclude Services from Metadata Pages

To exclude entire Services from showing up in Swagger or any other Metadata Services (i.e. Metadata Pages, Postman, NativeTypes, etc), annotate Request DTO’s with:

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

The [Exclude] Attribute exists in ServiceStack.Interfaces project under the ServiceStack.DataAnnotations namespace.