Excluding operations from metadata

Is it possible to exclude items from the list of operations on the metadata page?

setting [Exclude(Feature.Metadata)] on the requests, only grays them out

Nevermind, found it in another plugin

[Restrict(VisibilityTo = RequestAttributes.None)]

They’re only greyed out in DebugMode so you know they’re not visible, in normal Release mode they’re hidden.

So is there general guidance on when you should use MetadataAttribute vs RestrictAttribute?

I see most of the plugins that have similar services (postman was the example I looked through) use Restrict so that regardless of debug mode it is hidden so I’ve ended up going with that.

[Exclude(Feature.Metadata)] is a generic attribute to exclude the DTO from specific features like in metadata services, whereas Restrict limits the accessibility of the Service to specific scenarios.

1 Like