Skip to content

[F] getParameterVisibilityFilter

function getParameterVisibilityFilter(
program,
operation,
defaultProvider
): VisibilityFilter;

Gets the operation’s explicit parameter visibility as an any filter, or delegates to the supplied provider.

If you are not working in a protocol that has specific implicit visibility semantics, you can use the EmptyVisibilityProvider as a default provider. If you working in a protocol or context where parameters have implicit visibility transformations (like HTTP), you should use the visibility provider from that library (for HTTP, use the HttpVisibilityProvider from the @typespec/http library).

ParameterTypeDescription
programProgramthe Program in which the operation is defined
operationOperationthe Operation to get the parameter visibility filter for
defaultProviderVisibilityProviderrequired provider used when no explicit constraint is set; pass EmptyVisibilityProvider to consider all properties visible by default.

VisibilityFilter

a filter containing the explicit modifiers, or the provider’s parameter filter