Sneal
Sneal

Reputation: 2586

How can I hide endpoints from Swagger UI in Servicestack?

I'm using the Swagger plugin for ServiceStack 3.9.59.0. I have a few endpoints, for example /selfchecknode, in my ServiceStack API that I don't want to show up in the Swagger UI.

Is there a declarative way, perhaps via a contract attribute, that I can use to hide specific endpoints from showing up in Swagger?

Upvotes: 4

Views: 2477

Answers (1)

mythz
mythz

Reputation: 143319

The Security docs show how you can restrict visibility and access to ServiceStack. So you can hide it from being visible externally with:

[Restrict(VisibleInternalOnly = true)]
public class InternalAdmin { }

Upvotes: 3

Related Questions