How can I hide endpoints from Swagger UI in Servicestack?

六眼飞鱼酱① 提交于 2019-12-10 17:56:28

问题


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?


回答1:


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 { }


来源:https://stackoverflow.com/questions/19143059/how-can-i-hide-endpoints-from-swagger-ui-in-servicestack

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!