Skip to content

[F] getParameterVisibilityFilter

function getParameterVisibilityFilter(
program,
operation,
defaultProvider): VisibilityFilter

Get the visibility filter that should apply to the parameters of the given operation, or undefined if no parameter visibility is set.

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).

Parameters

ParameterTypeDescription
programProgramthe Program in which the operation is defined
operationOperationthe Operation to get the parameter visibility filter for
defaultProviderVisibilityProvidera provider for visibility filters that apply when no visibility constraints are explicitly set. Defaults to an empty provider that returns an empty filter if not provided.

Returns

VisibilityFilter

a visibility filter for the parameters of the operation, or undefined if no parameter visibility is set